functionObjects: Added fields() function to provide list of required fields to postProcess
With this change each functionObject provides the list of fields required so that the postProcess utility can pre-load them before executing the list of functionObjects. This provides a more convenient interface than using the -field or -fields command-line options to postProcess which are now redundant.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -134,6 +134,12 @@ public:
|
|||||||
//- Read the input data
|
//- Read the input data
|
||||||
virtual bool read(const dictionary& dict);
|
virtual bool read(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the force fields
|
//- Calculate the force fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -109,6 +109,12 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the force fields
|
//- Calculate the force fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -232,6 +232,12 @@ public:
|
|||||||
//- Read the sizeDistribution data
|
//- Read the sizeDistribution data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -74,6 +74,12 @@ bool Foam::functionObjects::writeVTK::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::writeVTK::fields() const
|
||||||
|
{
|
||||||
|
return objectNames_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::writeVTK::execute()
|
bool Foam::functionObjects::writeVTK::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -64,7 +64,6 @@ SourceFiles
|
|||||||
#define functionObjects_writeVTK_H
|
#define functionObjects_writeVTK_H
|
||||||
|
|
||||||
#include "fvMeshFunctionObject.H"
|
#include "fvMeshFunctionObject.H"
|
||||||
#include "wordReList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -84,7 +83,7 @@ class writeVTK
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Names of objects
|
//- Names of objects
|
||||||
wordReList objectNames_;
|
wordList objectNames_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -122,6 +121,9 @@ public:
|
|||||||
//- Read the writeVTK data
|
//- Read the writeVTK data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -33,22 +33,11 @@ template<class GeoField>
|
|||||||
Foam::UPtrList<const GeoField>
|
Foam::UPtrList<const GeoField>
|
||||||
Foam::functionObjects::writeVTK::lookupFields() const
|
Foam::functionObjects::writeVTK::lookupFields() const
|
||||||
{
|
{
|
||||||
DynamicList<word> allNames(obr_.toc().size());
|
UPtrList<const GeoField> fields(objectNames_.size());
|
||||||
|
|
||||||
forAll(objectNames_, i)
|
forAll(objectNames_, i)
|
||||||
{
|
{
|
||||||
wordList names(obr_.names<GeoField>(objectNames_[i]));
|
const GeoField& field = obr_.lookupObject<GeoField>(objectNames_[i]);
|
||||||
|
|
||||||
if (names.size())
|
|
||||||
{
|
|
||||||
allNames.append(names);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
UPtrList<const GeoField> fields(allNames.size());
|
|
||||||
|
|
||||||
forAll(allNames, i)
|
|
||||||
{
|
|
||||||
const GeoField& field = obr_.lookupObject<GeoField>(allNames[i]);
|
|
||||||
Info<< " Writing " << GeoField::typeName
|
Info<< " Writing " << GeoField::typeName
|
||||||
<< " field " << field.name() << endl;
|
<< " field " << field.name() << endl;
|
||||||
fields.set(i, &field);
|
fields.set(i, &field);
|
||||||
|
|||||||
@ -44,21 +44,21 @@ using namespace Foam;
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#define ReadFields(GeoFieldType) \
|
#define ReadFields(GeoFieldType) \
|
||||||
readFields<GeoFieldType>(mesh, objects, selectedFields, storedObjects);
|
readFields<GeoFieldType>(mesh, objects, requiredFields, storedObjects);
|
||||||
|
|
||||||
#define ReadPointFields(GeoFieldType) \
|
#define ReadPointFields(GeoFieldType) \
|
||||||
readFields<GeoFieldType>(pMesh, objects, selectedFields, storedObjects);
|
readFields<GeoFieldType>(pMesh, objects, requiredFields, storedObjects);
|
||||||
|
|
||||||
#define ReadUniformFields(FieldType) \
|
#define ReadUniformFields(FieldType) \
|
||||||
readUniformFields<FieldType> \
|
readUniformFields<FieldType> \
|
||||||
(constantObjects, selectedFields, storedObjects);
|
(constantObjects, requiredFields, storedObjects);
|
||||||
|
|
||||||
void executeFunctionObjects
|
void executeFunctionObjects
|
||||||
(
|
(
|
||||||
const argList& args,
|
const argList& args,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
fvMesh& mesh,
|
fvMesh& mesh,
|
||||||
const HashSet<word>& selectedFields,
|
const HashSet<word>& requiredFields0,
|
||||||
functionObjectList& functions,
|
functionObjectList& functions,
|
||||||
bool lastTime
|
bool lastTime
|
||||||
)
|
)
|
||||||
@ -72,6 +72,12 @@ void executeFunctionObjects
|
|||||||
// Read objects in time directory
|
// Read objects in time directory
|
||||||
IOobjectList objects(mesh, runTime.timeName());
|
IOobjectList objects(mesh, runTime.timeName());
|
||||||
|
|
||||||
|
HashSet<word> requiredFields(requiredFields0);
|
||||||
|
forAll(functions, i)
|
||||||
|
{
|
||||||
|
requiredFields.insert(functions[i].fields());
|
||||||
|
}
|
||||||
|
|
||||||
// Read volFields
|
// Read volFields
|
||||||
ReadFields(volScalarField);
|
ReadFields(volScalarField);
|
||||||
ReadFields(volVectorField);
|
ReadFields(volVectorField);
|
||||||
@ -151,14 +157,14 @@ int main(int argc, char *argv[])
|
|||||||
#include "createNamedMesh.H"
|
#include "createNamedMesh.H"
|
||||||
|
|
||||||
// Initialise the set of selected fields from the command-line options
|
// Initialise the set of selected fields from the command-line options
|
||||||
HashSet<word> selectedFields;
|
HashSet<word> requiredFields;
|
||||||
if (args.optionFound("fields"))
|
if (args.optionFound("fields"))
|
||||||
{
|
{
|
||||||
args.optionLookup("fields")() >> selectedFields;
|
args.optionLookup("fields")() >> requiredFields;
|
||||||
}
|
}
|
||||||
if (args.optionFound("field"))
|
if (args.optionFound("field"))
|
||||||
{
|
{
|
||||||
selectedFields.insert(args.optionLookup("field")());
|
requiredFields.insert(args.optionLookup("field")());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Externally stored dictionary for functionObjectList
|
// Externally stored dictionary for functionObjectList
|
||||||
@ -172,8 +178,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
args,
|
args,
|
||||||
runTime,
|
runTime,
|
||||||
functionsControlDict,
|
functionsControlDict
|
||||||
selectedFields
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -190,8 +195,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
args,
|
args,
|
||||||
runTime,
|
runTime,
|
||||||
functionsControlDict,
|
functionsControlDict
|
||||||
selectedFields
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +208,7 @@ int main(int argc, char *argv[])
|
|||||||
args,
|
args,
|
||||||
runTime,
|
runTime,
|
||||||
mesh,
|
mesh,
|
||||||
selectedFields,
|
requiredFields,
|
||||||
functionsPtr(),
|
functionsPtr(),
|
||||||
timei == timeDirs.size()-1
|
timei == timeDirs.size()-1
|
||||||
);
|
);
|
||||||
|
|||||||
@ -121,6 +121,22 @@ bool ${typeName}FunctionObject::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList ${typeName}FunctionObject::fields() const
|
||||||
|
{
|
||||||
|
if (${verbose:-false})
|
||||||
|
{
|
||||||
|
Info<<"fields ${typeName} sha1: ${SHA1sum}\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
wordList fields;
|
||||||
|
//{{{ begin code
|
||||||
|
${codeFields}
|
||||||
|
//}}} end code
|
||||||
|
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ${typeName}FunctionObject::execute()
|
bool ${typeName}FunctionObject::execute()
|
||||||
{
|
{
|
||||||
if (${verbose:-false})
|
if (${verbose:-false})
|
||||||
|
|||||||
@ -96,6 +96,9 @@ public:
|
|||||||
//- Read the system calls
|
//- Read the system calls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Execute the "executeCalls" at each time-step
|
//- Execute the "executeCalls" at each time-step
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -77,6 +77,12 @@ bool Foam::functionObjects::FUNCTIONOBJECT::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::FUNCTIONOBJECT::fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::FUNCTIONOBJECT::execute()
|
bool Foam::functionObjects::FUNCTIONOBJECT::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -118,6 +118,9 @@ public:
|
|||||||
//- Read the FUNCTIONOBJECT data
|
//- Read the FUNCTIONOBJECT data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -58,14 +58,11 @@ bool Foam::functionEntries::includeFuncEntry::execute
|
|||||||
// Read line containing the function name and the optional arguments
|
// Read line containing the function name and the optional arguments
|
||||||
const string fNameArgs(readFuncNameArgs(is));
|
const string fNameArgs(readFuncNameArgs(is));
|
||||||
|
|
||||||
HashSet<word> selectedFields;
|
|
||||||
|
|
||||||
return functionObjectList::readFunctionObject
|
return functionObjectList::readFunctionObject
|
||||||
(
|
(
|
||||||
fNameArgs,
|
fNameArgs,
|
||||||
parentDict,
|
parentDict,
|
||||||
{"file", is.name() + " at line " + Foam::name(is.lineNumber())},
|
{"file", is.name() + " at line " + Foam::name(is.lineNumber())}
|
||||||
selectedFields
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -214,6 +214,9 @@ public:
|
|||||||
//- Read and set the functionObject if its data have changed
|
//- Read and set the functionObject if its data have changed
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const = 0;
|
||||||
|
|
||||||
//- Return true if the functionObject should be executed at the start
|
//- Return true if the functionObject should be executed at the start
|
||||||
virtual bool executeAtStart() const;
|
virtual bool executeAtStart() const;
|
||||||
|
|
||||||
|
|||||||
@ -236,7 +236,6 @@ bool Foam::functionObjectList::readFunctionObject
|
|||||||
const string& funcArgs,
|
const string& funcArgs,
|
||||||
dictionary& functionsDict,
|
dictionary& functionsDict,
|
||||||
const Pair<string>& contextTypeAndValue,
|
const Pair<string>& contextTypeAndValue,
|
||||||
HashSet<word>& requiredFields,
|
|
||||||
const word& region
|
const word& region
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -434,37 +433,6 @@ bool Foam::functionObjectList::readFunctionObject
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lookup the field, fields and objects entries from the now expanded
|
|
||||||
// funcDict and insert into the requiredFields
|
|
||||||
dictionary& expandedFuncDict = funcArgsDict.subDict(funcName);
|
|
||||||
if (functionObject::debug)
|
|
||||||
{
|
|
||||||
InfoInFunction
|
|
||||||
<< nl << incrIndent << indent
|
|
||||||
<< funcArgs << expandedFuncDict
|
|
||||||
<< decrIndent << endl;
|
|
||||||
}
|
|
||||||
if (expandedFuncDict.found("field"))
|
|
||||||
{
|
|
||||||
requiredFields.insert(word(expandedFuncDict.lookup("field")));
|
|
||||||
}
|
|
||||||
if (expandedFuncDict.found("fields"))
|
|
||||||
{
|
|
||||||
List<wordAndDictionary> fields(expandedFuncDict.lookup("fields"));
|
|
||||||
forAll(fields, i)
|
|
||||||
{
|
|
||||||
requiredFields.insert(fields[i].first());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (expandedFuncDict.found("objects"))
|
|
||||||
{
|
|
||||||
List<wordAndDictionary> objects(expandedFuncDict.lookup("objects"));
|
|
||||||
forAll(objects, i)
|
|
||||||
{
|
|
||||||
requiredFields.insert(objects[i].first());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Merge this functionObject dictionary into functionsDict
|
// Merge this functionObject dictionary into functionsDict
|
||||||
functionsDict.merge(funcArgsDict);
|
functionsDict.merge(funcArgsDict);
|
||||||
functionsDict.subDict(funcName).name() = funcDict.name();
|
functionsDict.subDict(funcName).name() = funcDict.name();
|
||||||
@ -512,8 +480,7 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New
|
|||||||
(
|
(
|
||||||
const argList& args,
|
const argList& args,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
dictionary& controlDict,
|
dictionary& controlDict
|
||||||
HashSet<word>& requiredFields
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
autoPtr<functionObjectList> functionsPtr;
|
autoPtr<functionObjectList> functionsPtr;
|
||||||
@ -563,7 +530,6 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New
|
|||||||
args["func"],
|
args["func"],
|
||||||
functionsDict,
|
functionsDict,
|
||||||
{"command", args.commandLine()},
|
{"command", args.commandLine()},
|
||||||
requiredFields,
|
|
||||||
region
|
region
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -579,7 +545,6 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New
|
|||||||
funcs[i],
|
funcs[i],
|
||||||
functionsDict,
|
functionsDict,
|
||||||
{"command", args.commandLine()},
|
{"command", args.commandLine()},
|
||||||
requiredFields,
|
|
||||||
region
|
region
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -149,8 +149,7 @@ public:
|
|||||||
(
|
(
|
||||||
const argList& args,
|
const argList& args,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
dictionary& controlDict,
|
dictionary& controlDict
|
||||||
HashSet<word>& requiredFields
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -223,8 +222,6 @@ public:
|
|||||||
// parsing the optional arguments included in the string 'funcArgs',
|
// parsing the optional arguments included in the string 'funcArgs',
|
||||||
// inserting 'field' or 'fields' entries as required and merging the
|
// inserting 'field' or 'fields' entries as required and merging the
|
||||||
// resulting functionObject dictionary into 'functionsDict'.
|
// resulting functionObject dictionary into 'functionsDict'.
|
||||||
// Any fields required to execute the functionObject are added to
|
|
||||||
// 'requiredFields'
|
|
||||||
//
|
//
|
||||||
// Parses the optional functionObject arguments:
|
// Parses the optional functionObject arguments:
|
||||||
// 'Q(U)' -> funcName = Q; args = (U)
|
// 'Q(U)' -> funcName = Q; args = (U)
|
||||||
@ -243,7 +240,6 @@ public:
|
|||||||
const string& funcArgs,
|
const string& funcArgs,
|
||||||
dictionary& functionsDict,
|
dictionary& functionsDict,
|
||||||
const Pair<string>& contextTypeAndValue,
|
const Pair<string>& contextTypeAndValue,
|
||||||
HashSet<word>& requiredFields,
|
|
||||||
const word& region = word::null
|
const word& region = word::null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -116,8 +116,6 @@ if (argList::postProcess(argc, argv))
|
|||||||
// if not constructed from runTime
|
// if not constructed from runTime
|
||||||
dictionary functionsControlDict("controlDict");
|
dictionary functionsControlDict("controlDict");
|
||||||
|
|
||||||
HashSet<word> selectedFields;
|
|
||||||
|
|
||||||
// Construct functionObjectList
|
// Construct functionObjectList
|
||||||
autoPtr<functionObjectList> functionsPtr
|
autoPtr<functionObjectList> functionsPtr
|
||||||
(
|
(
|
||||||
@ -125,8 +123,7 @@ if (argList::postProcess(argc, argv))
|
|||||||
(
|
(
|
||||||
args,
|
args,
|
||||||
runTime,
|
runTime,
|
||||||
functionsControlDict,
|
functionsControlDict
|
||||||
selectedFields
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -95,6 +95,12 @@ Foam::functionObjects::timeControl::timeControl
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::timeControl::fields() const
|
||||||
|
{
|
||||||
|
return foPtr_->fields();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::timeControl::executeAtStart() const
|
bool Foam::functionObjects::timeControl::executeAtStart() const
|
||||||
{
|
{
|
||||||
return foPtr_->executeAtStart();
|
return foPtr_->executeAtStart();
|
||||||
|
|||||||
@ -136,6 +136,9 @@ public:
|
|||||||
|
|
||||||
// Function object control
|
// Function object control
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Return true if the functionObject should be executed
|
//- Return true if the functionObject should be executed
|
||||||
// at the start
|
// at the start
|
||||||
virtual bool executeAtStart() const;
|
virtual bool executeAtStart() const;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -71,19 +71,19 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
inline label size() const;
|
inline label size() const;
|
||||||
inline bool empty() const;
|
|
||||||
|
inline bool empty() const;
|
||||||
|
|
||||||
//- Return underlying list of wordRe
|
//- Return underlying list of wordRe
|
||||||
inline const UList<wordRe>& operator()() const;
|
inline const UList<wordRe>& operator()() const;
|
||||||
|
|
||||||
|
|
||||||
// Searching
|
// Searching
|
||||||
|
|
||||||
//- Return true if string matches any of the regular expressions
|
//- Return true if string matches any of the regular expressions
|
||||||
// Smart match as regular expression or as a string.
|
// Smart match as regular expression or as a string.
|
||||||
// Optionally specify a literal match only.
|
// Optionally specify a literal match only.
|
||||||
inline bool match(const string&, bool literalMatch=false) const;
|
inline bool match(const string&, bool literalMatch=false) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -89,6 +89,12 @@ public:
|
|||||||
//- Read the data
|
//- Read the data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the Qdot field
|
//- Calculate the Qdot field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -63,6 +63,12 @@ Foam::functionObjects::XiReactionRate::~XiReactionRate()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::XiReactionRate::fields() const
|
||||||
|
{
|
||||||
|
return wordList{"b", "Su", "Xi"};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::XiReactionRate::execute()
|
bool Foam::functionObjects::XiReactionRate::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -98,6 +98,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Do nothing
|
//- Do nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -124,6 +124,12 @@ bool Foam::functionObjects::age::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::age::fields() const
|
||||||
|
{
|
||||||
|
return wordList{phiName_, rhoName_};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::age::execute()
|
bool Foam::functionObjects::age::execute()
|
||||||
{
|
{
|
||||||
tmp<volScalarField> tage
|
tmp<volScalarField> tage
|
||||||
|
|||||||
@ -145,6 +145,9 @@ public:
|
|||||||
//- Read the data
|
//- Read the data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Execute
|
//- Execute
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -298,6 +298,12 @@ bool Foam::functionObjects::comfort::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::comfort::fields() const
|
||||||
|
{
|
||||||
|
return wordList{"U", "T"};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::comfort::execute()
|
bool Foam::functionObjects::comfort::execute()
|
||||||
{
|
{
|
||||||
const dimensionedScalar Trad(this->Trad());
|
const dimensionedScalar Trad(this->Trad());
|
||||||
|
|||||||
@ -191,6 +191,9 @@ public:
|
|||||||
//- Read the data needed for the comfort calculation
|
//- Read the data needed for the comfort calculation
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Calculate the predicted mean vote (PMV)
|
//- Calculate the predicted mean vote (PMV)
|
||||||
// and predicted percentage dissatisfaction (PPD) fields
|
// and predicted percentage dissatisfaction (PPD) fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|||||||
@ -367,6 +367,19 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::fieldAverage::fields() const
|
||||||
|
{
|
||||||
|
wordList fields(faItems_.size());
|
||||||
|
|
||||||
|
forAll(faItems_, fieldi)
|
||||||
|
{
|
||||||
|
fields[fieldi] = faItems_[fieldi].fieldName();
|
||||||
|
}
|
||||||
|
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::fieldAverage::execute()
|
bool Foam::functionObjects::fieldAverage::execute()
|
||||||
{
|
{
|
||||||
calcAverages();
|
calcAverages();
|
||||||
|
|||||||
@ -339,6 +339,9 @@ public:
|
|||||||
//- Read the field average data
|
//- Read the field average data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Do not average at the start of the run
|
//- Do not average at the start of the run
|
||||||
virtual bool executeAtStart() const
|
virtual bool executeAtStart() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -55,7 +55,7 @@ fieldCoordinateSystemTransform
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
fvMeshFunctionObject(name, runTime, dict),
|
||||||
fieldSet_(),
|
fields_(),
|
||||||
coordSys_(coordinateSystem::New(mesh_, dict.subDict("coordinateSystem"))())
|
coordSys_(coordinateSystem::New(mesh_, dict.subDict("coordinateSystem"))())
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
@ -92,21 +92,28 @@ bool Foam::functionObjects::fieldCoordinateSystemTransform::read
|
|||||||
{
|
{
|
||||||
fvMeshFunctionObject::read(dict);
|
fvMeshFunctionObject::read(dict);
|
||||||
|
|
||||||
dict.lookup("fields") >> fieldSet_;
|
dict.lookup("fields") >> fields_;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList
|
||||||
|
Foam::functionObjects::fieldCoordinateSystemTransform::fields() const
|
||||||
|
{
|
||||||
|
return fields_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::fieldCoordinateSystemTransform::execute()
|
bool Foam::functionObjects::fieldCoordinateSystemTransform::execute()
|
||||||
{
|
{
|
||||||
forAll(fieldSet_, fieldi)
|
forAll(fields_, fieldi)
|
||||||
{
|
{
|
||||||
transform<scalar>(fieldSet_[fieldi]);
|
transform<scalar>(fields_[fieldi]);
|
||||||
transform<vector>(fieldSet_[fieldi]);
|
transform<vector>(fields_[fieldi]);
|
||||||
transform<sphericalTensor>(fieldSet_[fieldi]);
|
transform<sphericalTensor>(fields_[fieldi]);
|
||||||
transform<symmTensor>(fieldSet_[fieldi]);
|
transform<symmTensor>(fields_[fieldi]);
|
||||||
transform<tensor>(fieldSet_[fieldi]);
|
transform<tensor>(fields_[fieldi]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -115,9 +122,9 @@ bool Foam::functionObjects::fieldCoordinateSystemTransform::execute()
|
|||||||
|
|
||||||
bool Foam::functionObjects::fieldCoordinateSystemTransform::write()
|
bool Foam::functionObjects::fieldCoordinateSystemTransform::write()
|
||||||
{
|
{
|
||||||
forAll(fieldSet_, fieldi)
|
forAll(fields_, fieldi)
|
||||||
{
|
{
|
||||||
writeObject(transformFieldName(fieldSet_[fieldi]));
|
writeObject(transformFieldName(fields_[fieldi]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -100,7 +100,7 @@ protected:
|
|||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Fields to transform
|
//- Fields to transform
|
||||||
wordList fieldSet_;
|
wordList fields_;
|
||||||
|
|
||||||
//- Co-ordinate system to transform to
|
//- Co-ordinate system to transform to
|
||||||
coordinateSystem coordSys_;
|
coordinateSystem coordSys_;
|
||||||
@ -146,6 +146,9 @@ public:
|
|||||||
//- Read the input data
|
//- Read the input data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the field required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Calculate the transformed fields
|
//- Calculate the transformed fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,6 +75,12 @@ bool Foam::functionObjects::fieldExpression::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::fieldExpression::fields() const
|
||||||
|
{
|
||||||
|
return wordList(fieldName_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::fieldExpression::execute()
|
bool Foam::functionObjects::fieldExpression::execute()
|
||||||
{
|
{
|
||||||
if (!calc())
|
if (!calc())
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -101,6 +101,9 @@ public:
|
|||||||
//- Read the fieldExpression data
|
//- Read the fieldExpression data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the field required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Calculate the result field
|
//- Calculate the result field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -163,8 +163,8 @@ public:
|
|||||||
//- Return the region name
|
//- Return the region name
|
||||||
inline const word& regionName() const;
|
inline const word& regionName() const;
|
||||||
|
|
||||||
//- Return the list of field names
|
//- Return the list of fields required
|
||||||
inline const wordList& fields() const;
|
inline virtual wordList fields() const;
|
||||||
|
|
||||||
//- Return the output field values flag
|
//- Return the output field values flag
|
||||||
inline const Switch& writeFields() const;
|
inline const Switch& writeFields() const;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,7 +40,7 @@ inline const Foam::word& Foam::functionObjects::fieldValue::regionName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::wordList& Foam::functionObjects::fieldValue::fields() const
|
inline Foam::wordList Foam::functionObjects::fieldValue::fields() const
|
||||||
{
|
{
|
||||||
return fields_;
|
return fields_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,8 +68,8 @@ void Foam::functionObjects::fieldValues::fieldValueDelta::writeFileHeader
|
|||||||
const label i
|
const label i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const wordList& fields1 = region1Ptr_->fields();
|
const wordList fields1 = region1Ptr_->fields();
|
||||||
const wordList& fields2 = region2Ptr_->fields();
|
const wordList fields2 = region2Ptr_->fields();
|
||||||
|
|
||||||
DynamicList<word> commonFields(fields1.size());
|
DynamicList<word> commonFields(fields1.size());
|
||||||
forAll(fields1, fieldi)
|
forAll(fields1, fieldi)
|
||||||
@ -160,6 +160,13 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList
|
||||||
|
Foam::functionObjects::fieldValues::fieldValueDelta::fields() const
|
||||||
|
{
|
||||||
|
return region1Ptr_->fields();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::fieldValues::fieldValueDelta::write()
|
bool Foam::functionObjects::fieldValues::fieldValueDelta::write()
|
||||||
{
|
{
|
||||||
logFiles::write();
|
logFiles::write();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -172,6 +172,9 @@ public:
|
|||||||
//- Read from dictionary
|
//- Read from dictionary
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Do nothing
|
//- Do nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -87,7 +87,7 @@ void Foam::functionObjects::fieldValues::fieldValueDelta::processFields
|
|||||||
typedef GeometricField<Type, fvPatchField, volMesh> vf;
|
typedef GeometricField<Type, fvPatchField, volMesh> vf;
|
||||||
typedef GeometricField<Type, fvsPatchField, surfaceMesh> sf;
|
typedef GeometricField<Type, fvsPatchField, surfaceMesh> sf;
|
||||||
|
|
||||||
const wordList& fields1 = region1Ptr_->fields();
|
const wordList fields1 = region1Ptr_->fields();
|
||||||
|
|
||||||
const dictionary& results1 = region1Ptr_->resultDict();
|
const dictionary& results1 = region1Ptr_->resultDict();
|
||||||
const dictionary& results2 = region2Ptr_->resultDict();
|
const dictionary& results2 = region2Ptr_->resultDict();
|
||||||
|
|||||||
@ -123,6 +123,12 @@ bool Foam::functionObjects::fieldsExpression::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::fieldsExpression::fields() const
|
||||||
|
{
|
||||||
|
return fieldNames_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::fieldsExpression::execute()
|
bool Foam::functionObjects::fieldsExpression::execute()
|
||||||
{
|
{
|
||||||
if (!calc())
|
if (!calc())
|
||||||
|
|||||||
@ -170,6 +170,9 @@ public:
|
|||||||
//- Read the fieldsExpression data
|
//- Read the fieldsExpression data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Calculate the result fields
|
//- Calculate the result fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -104,6 +104,12 @@ bool Foam::functionObjects::histogram::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::histogram::fields() const
|
||||||
|
{
|
||||||
|
return wordList(fieldName_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::histogram::execute()
|
bool Foam::functionObjects::histogram::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -145,6 +145,9 @@ public:
|
|||||||
//- Read the histogram data
|
//- Read the histogram data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -250,6 +250,12 @@ bool Foam::functionObjects::interfaceHeight::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::interfaceHeight::fields() const
|
||||||
|
{
|
||||||
|
return wordList(alphaName_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::interfaceHeight::execute()
|
bool Foam::functionObjects::interfaceHeight::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -152,6 +152,9 @@ public:
|
|||||||
//- Read
|
//- Read
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Execute
|
//- Execute
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -234,10 +234,10 @@ bool Foam::functionObjects::nearWallFields::read(const dictionary& dict)
|
|||||||
// Convert field to map
|
// Convert field to map
|
||||||
fieldMap_.resize(2*fieldSet_.size());
|
fieldMap_.resize(2*fieldSet_.size());
|
||||||
reverseFieldMap_.resize(2*fieldSet_.size());
|
reverseFieldMap_.resize(2*fieldSet_.size());
|
||||||
forAll(fieldSet_, setI)
|
forAll(fieldSet_, seti)
|
||||||
{
|
{
|
||||||
const word& fldName = fieldSet_[setI].first();
|
const word& fldName = fieldSet_[seti].first();
|
||||||
const word& sampleFldName = fieldSet_[setI].second();
|
const word& sampleFldName = fieldSet_[seti].second();
|
||||||
|
|
||||||
fieldMap_.insert(fldName, sampleFldName);
|
fieldMap_.insert(fldName, sampleFldName);
|
||||||
reverseFieldMap_.insert(sampleFldName, fldName);
|
reverseFieldMap_.insert(sampleFldName, fldName);
|
||||||
@ -253,6 +253,19 @@ bool Foam::functionObjects::nearWallFields::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::nearWallFields::fields() const
|
||||||
|
{
|
||||||
|
wordList fields(fieldSet_.size());
|
||||||
|
|
||||||
|
forAll(fieldSet_, fieldi)
|
||||||
|
{
|
||||||
|
fields[fieldi] = fieldSet_[fieldi].first();
|
||||||
|
}
|
||||||
|
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::nearWallFields::execute()
|
bool Foam::functionObjects::nearWallFields::execute()
|
||||||
{
|
{
|
||||||
DebugInFunction << endl;
|
DebugInFunction << endl;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -195,6 +195,9 @@ public:
|
|||||||
//- Read the controls
|
//- Read the controls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Calculate the near-wall fields
|
//- Calculate the near-wall fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -101,6 +101,12 @@ public:
|
|||||||
//- Read the input data
|
//- Read the input data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the processorID field
|
//- Calculate the processorID field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -50,7 +50,7 @@ Foam::functionObjects::readFields::readFields
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
fvMeshFunctionObject(name, runTime, dict),
|
||||||
fieldSet_()
|
fields_()
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
}
|
}
|
||||||
@ -68,12 +68,18 @@ bool Foam::functionObjects::readFields::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
fvMeshFunctionObject::read(dict);
|
fvMeshFunctionObject::read(dict);
|
||||||
|
|
||||||
dict.lookup("fields") >> fieldSet_;
|
dict.lookup("fields") >> fields_;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::readFields::fields() const
|
||||||
|
{
|
||||||
|
return fields_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::readFields::execute()
|
bool Foam::functionObjects::readFields::execute()
|
||||||
{
|
{
|
||||||
// Clear out any previously loaded fields
|
// Clear out any previously loaded fields
|
||||||
@ -89,9 +95,9 @@ bool Foam::functionObjects::readFields::execute()
|
|||||||
sSymmtf_.clear();
|
sSymmtf_.clear();
|
||||||
stf_.clear();
|
stf_.clear();
|
||||||
|
|
||||||
forAll(fieldSet_, fieldi)
|
forAll(fields_, fieldi)
|
||||||
{
|
{
|
||||||
const word& fieldName = fieldSet_[fieldi];
|
const word& fieldName = fields_[fieldi];
|
||||||
|
|
||||||
// If necessary load field
|
// If necessary load field
|
||||||
loadField<scalar>(fieldName, vsf_, ssf_);
|
loadField<scalar>(fieldName, vsf_, ssf_);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -85,7 +85,7 @@ protected:
|
|||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Fields to load
|
//- Fields to load
|
||||||
wordList fieldSet_;
|
wordList fields_;
|
||||||
|
|
||||||
//- Loaded fields
|
//- Loaded fields
|
||||||
PtrList<volScalarField> vsf_;
|
PtrList<volScalarField> vsf_;
|
||||||
@ -142,6 +142,9 @@ public:
|
|||||||
//- Read the set of fields from dictionary
|
//- Read the set of fields from dictionary
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Read the fields
|
//- Read the fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -331,7 +331,7 @@ Foam::functionObjects::regionSizeDistribution::regionSizeDistribution
|
|||||||
:
|
:
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
fvMeshFunctionObject(name, runTime, dict),
|
||||||
file_(obr_, name),
|
file_(obr_, name),
|
||||||
alphaName_(dict.lookup("field")),
|
alphaName_(dict.lookup("alpha")),
|
||||||
patchNames_(dict.lookup("patches"))
|
patchNames_(dict.lookup("patches"))
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
@ -372,6 +372,14 @@ bool Foam::functionObjects::regionSizeDistribution::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::regionSizeDistribution::fields() const
|
||||||
|
{
|
||||||
|
wordList fields(fields_);
|
||||||
|
fields.append(alphaName_);
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::regionSizeDistribution::execute()
|
bool Foam::functionObjects::regionSizeDistribution::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@ -745,92 +753,88 @@ bool Foam::functionObjects::regionSizeDistribution::write()
|
|||||||
|
|
||||||
// Collect some more field
|
// Collect some more field
|
||||||
{
|
{
|
||||||
wordList scalarNames(obr_.names(volScalarField::typeName));
|
forAll(fields_, i)
|
||||||
labelList selected = findStrings(fields_, scalarNames);
|
|
||||||
|
|
||||||
forAll(selected, i)
|
|
||||||
{
|
{
|
||||||
const word& fldName = scalarNames[selected[i]];
|
if (obr_.foundObject<volScalarField>(fields_[i]))
|
||||||
Info<< " Scalar field " << fldName << endl;
|
{
|
||||||
|
Info<< " Scalar field " << fields_[i] << endl;
|
||||||
|
|
||||||
const scalarField& fld = obr_.lookupObject
|
const scalarField& fld =
|
||||||
<
|
obr_.lookupObject<volScalarField>(fields_[i])
|
||||||
volScalarField
|
.primitiveField();
|
||||||
>(fldName).primitiveField();
|
|
||||||
|
|
||||||
writeGraphs
|
writeGraphs
|
||||||
(
|
(
|
||||||
fldName, // name of field
|
fields_[i], // name of field
|
||||||
alphaVol*fld, // per cell field data
|
alphaVol*fld, // per cell field data
|
||||||
|
|
||||||
regions, // per cell the region(=droplet)
|
regions, // per cell the region(=droplet)
|
||||||
sortedRegions, // valid regions in sorted order
|
sortedRegions, // valid regions in sorted order
|
||||||
1.0/sortedVols, // per region normalisation
|
1.0/sortedVols, // per region normalisation
|
||||||
|
|
||||||
indices, // index of bin for each region
|
indices, // index of bin for each region
|
||||||
binCount, // per bin number of regions
|
binCount, // per bin number of regions
|
||||||
coords // graph data for bins
|
coords // graph data for bins
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
wordList vectorNames(obr_.names(volVectorField::typeName));
|
forAll(fields_, i)
|
||||||
labelList selected = findStrings(fields_, vectorNames);
|
|
||||||
|
|
||||||
forAll(selected, i)
|
|
||||||
{
|
{
|
||||||
const word& fldName = vectorNames[selected[i]];
|
if (obr_.foundObject<volScalarField>(fields_[i]))
|
||||||
Info<< " Vector field " << fldName << endl;
|
|
||||||
|
|
||||||
vectorField fld = obr_.lookupObject
|
|
||||||
<
|
|
||||||
volVectorField
|
|
||||||
>(fldName).primitiveField();
|
|
||||||
|
|
||||||
if (coordSysPtr_.valid())
|
|
||||||
{
|
{
|
||||||
Info<< "Transforming vector field " << fldName
|
Info<< " Vector field " << fields_[i] << endl;
|
||||||
<< " with coordinate system "
|
|
||||||
<< coordSysPtr_().name()
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
fld = coordSysPtr_().localVector(fld);
|
vectorField fld =
|
||||||
}
|
obr_.lookupObject<volVectorField>(fields_[i])
|
||||||
|
.primitiveField();
|
||||||
|
|
||||||
|
if (coordSysPtr_.valid())
|
||||||
|
{
|
||||||
|
Info<< "Transforming vector field " << fields_[i]
|
||||||
|
<< " with coordinate system "
|
||||||
|
<< coordSysPtr_().name()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
fld = coordSysPtr_().localVector(fld);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
|
|
||||||
for (direction cmp = 0; cmp < vector::nComponents; cmp++)
|
for (direction cmp = 0; cmp < vector::nComponents; cmp++)
|
||||||
{
|
{
|
||||||
|
writeGraphs
|
||||||
|
(
|
||||||
|
fields_[i] + vector::componentNames[cmp],
|
||||||
|
alphaVol*fld.component(cmp),// per cell field data
|
||||||
|
|
||||||
|
regions, // per cell the region(=droplet)
|
||||||
|
sortedRegions, // valid regions in sorted order
|
||||||
|
1.0/sortedVols, // per region normalisation
|
||||||
|
|
||||||
|
indices, // index of bin for each region
|
||||||
|
binCount, // per bin number of regions
|
||||||
|
coords // graph data for bins
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Magnitude
|
||||||
writeGraphs
|
writeGraphs
|
||||||
(
|
(
|
||||||
fldName + vector::componentNames[cmp],
|
fields_[i] + "mag", // name of field
|
||||||
alphaVol*fld.component(cmp),// per cell field data
|
alphaVol*mag(fld), // per cell field data
|
||||||
|
|
||||||
regions, // per cell the region(=droplet)
|
regions, // per cell the region(=droplet)
|
||||||
sortedRegions, // valid regions in sorted order
|
sortedRegions, // valid regions in sorted order
|
||||||
1.0/sortedVols, // per region normalisation
|
1.0/sortedVols, // per region normalisation
|
||||||
|
|
||||||
indices, // index of bin for each region
|
indices, // index of bin for each region
|
||||||
binCount, // per bin number of regions
|
binCount, // per bin number of regions
|
||||||
coords // graph data for bins
|
coords // graph data for bins
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Magnitude
|
|
||||||
writeGraphs
|
|
||||||
(
|
|
||||||
fldName + "mag", // name of field
|
|
||||||
alphaVol*mag(fld), // per cell field data
|
|
||||||
|
|
||||||
regions, // per cell the region(=droplet)
|
|
||||||
sortedRegions, // valid regions in sorted order
|
|
||||||
1.0/sortedVols, // per region normalisation
|
|
||||||
|
|
||||||
indices, // index of bin for each region
|
|
||||||
binCount, // per bin number of regions
|
|
||||||
coords // graph data for bins
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ Description
|
|||||||
type regionSizeDistribution;
|
type regionSizeDistribution;
|
||||||
libs ("libfieldFunctionObjects.so");
|
libs ("libfieldFunctionObjects.so");
|
||||||
...
|
...
|
||||||
field alpha;
|
alpha alpha;
|
||||||
patches (inlet);
|
patches (inlet);
|
||||||
threshold 0.4;
|
threshold 0.4;
|
||||||
fields (p U);
|
fields (p U);
|
||||||
@ -80,7 +80,7 @@ Usage
|
|||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
type | type name: regionSizeDistribution |yes|
|
type | type name: regionSizeDistribution |yes|
|
||||||
field | phase field to interrogate | yes |
|
alpha | phase field to interrogate | yes |
|
||||||
patches | patches from which the liquid core is identified | yes|
|
patches | patches from which the liquid core is identified | yes|
|
||||||
threshold | phase fraction applied to delimit regions | yes |
|
threshold | phase fraction applied to delimit regions | yes |
|
||||||
fields | fields to sample | yes |
|
fields | fields to sample | yes |
|
||||||
@ -154,7 +154,7 @@ class regionSizeDistribution
|
|||||||
label nBins_;
|
label nBins_;
|
||||||
|
|
||||||
//- Names of fields to sample on regions
|
//- Names of fields to sample on regions
|
||||||
wordReList fields_;
|
wordList fields_;
|
||||||
|
|
||||||
//- Output formatter to write
|
//- Output formatter to write
|
||||||
autoPtr<setWriter<scalar>> formatterPtr_;
|
autoPtr<setWriter<scalar>> formatterPtr_;
|
||||||
@ -253,6 +253,9 @@ public:
|
|||||||
//- Read the regionSizeDistribution data
|
//- Read the regionSizeDistribution data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Do nothing
|
//- Do nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -91,6 +91,12 @@ public:
|
|||||||
//- Read the data
|
//- Read the data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the shearStress field
|
//- Calculate the shearStress field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -61,7 +61,7 @@ class streamFunction
|
|||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
tmp<pointScalarField> calc(const surfaceScalarField& phi) const;
|
tmp<pointScalarField> calc(const surfaceScalarField& phi) const;
|
||||||
|
|
||||||
//- Calculate the stream-function and return true if successful
|
//- Calculate the stream-function and return true if successful
|
||||||
virtual bool calc();
|
virtual bool calc();
|
||||||
|
|||||||
@ -429,6 +429,15 @@ bool Foam::functionObjects::streamlines::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::streamlines::fields() const
|
||||||
|
{
|
||||||
|
wordList allFields(fields_);
|
||||||
|
allFields.append(UName_);
|
||||||
|
|
||||||
|
return allFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::streamlines::execute()
|
bool Foam::functionObjects::streamlines::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -261,6 +261,9 @@ public:
|
|||||||
//- Read the field average data
|
//- Read the field average data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Do nothing
|
//- Do nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -91,6 +91,12 @@ public:
|
|||||||
//- Read the data
|
//- Read the data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the totalEnthalpy field
|
//- Calculate the totalEnthalpy field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -195,6 +195,12 @@ public:
|
|||||||
//- Read the controls
|
//- Read the controls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate turbulence fields
|
//- Calculate turbulence fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -138,6 +138,12 @@ public:
|
|||||||
//- Read the turbulenceIntensity data
|
//- Read the turbulenceIntensity data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the turbulenceIntensity field
|
//- Calculate the turbulenceIntensity field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -100,6 +100,12 @@ public:
|
|||||||
//- Read the uniform data
|
//- Read the uniform data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the field
|
//- Calculate the field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -141,6 +141,12 @@ public:
|
|||||||
//- Read the wallHeatFlux data
|
//- Read the wallHeatFlux data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the wall heat-flux
|
//- Calculate the wall heat-flux
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -187,6 +187,12 @@ public:
|
|||||||
//- Read the wallHeatTransferCoeffs data
|
//- Read the wallHeatTransferCoeffs data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the wall heat transfer coefficient
|
//- Calculate the wall heat transfer coefficient
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -152,6 +152,12 @@ public:
|
|||||||
//- Read the wallShearStress data
|
//- Read the wallShearStress data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the wall shear-stress
|
//- Calculate the wall shear-stress
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -98,6 +98,12 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Do nothing
|
//- Do nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -97,6 +97,12 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Do nothing
|
//- Do nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -141,6 +141,12 @@ public:
|
|||||||
//- Read the yPlus data
|
//- Read the yPlus data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the yPlus field
|
//- Calculate the yPlus field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -311,6 +311,12 @@ public:
|
|||||||
//- Read the forces data
|
//- Read the forces data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Calculate the forces and moments
|
//- Calculate the forces and moments
|
||||||
virtual void calcForcesMoment();
|
virtual void calcForcesMoment();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -125,6 +125,12 @@ public:
|
|||||||
//- Read the controls
|
//- Read the controls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -79,6 +79,21 @@ bool Foam::functionObjects::dsmcFields::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::dsmcFields::fields() const
|
||||||
|
{
|
||||||
|
return wordList
|
||||||
|
{
|
||||||
|
"rhoNMean",
|
||||||
|
"rhoMMean",
|
||||||
|
"momentumMean",
|
||||||
|
"linearKEMean",
|
||||||
|
"internalEMean",
|
||||||
|
"iDofMean",
|
||||||
|
"fDMean"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::dsmcFields::execute()
|
bool Foam::functionObjects::dsmcFields::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -89,6 +89,9 @@ public:
|
|||||||
//- Read the dsmcFields data
|
//- Read the dsmcFields data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Do not evaluate the state at the start of the run
|
//- Do not evaluate the state at the start of the run
|
||||||
virtual bool executeAtStart() const
|
virtual bool executeAtStart() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -147,6 +147,12 @@ public:
|
|||||||
//- Read the controls
|
//- Read the controls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Track the cloud
|
//- Track the cloud
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -364,6 +364,12 @@ bool Foam::functionObjects::phaseScalarTransport::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::phaseScalarTransport::fields() const
|
||||||
|
{
|
||||||
|
return wordList{alphaName_, alphaPhiName_, phiName_, pName_};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::phaseScalarTransport::execute()
|
bool Foam::functionObjects::phaseScalarTransport::execute()
|
||||||
{
|
{
|
||||||
Info<< type() << ": Executing" << endl;
|
Info<< type() << ": Executing" << endl;
|
||||||
|
|||||||
@ -215,6 +215,9 @@ public:
|
|||||||
//- Read the settings from the given dictionary
|
//- Read the settings from the given dictionary
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Solve for the evolution of the field
|
//- Solve for the evolution of the field
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -155,6 +155,12 @@ bool Foam::functionObjects::scalarTransport::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::functionObjects::scalarTransport::fields() const
|
||||||
|
{
|
||||||
|
return wordList{phiName_};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::scalarTransport::execute()
|
bool Foam::functionObjects::scalarTransport::execute()
|
||||||
{
|
{
|
||||||
Info<< type() << " write:" << endl;
|
Info<< type() << " write:" << endl;
|
||||||
|
|||||||
@ -137,6 +137,9 @@ public:
|
|||||||
//- Read the scalarTransport data
|
//- Read the scalarTransport data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Calculate the scalarTransport
|
//- Calculate the scalarTransport
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,7 @@ Foam::wordList Foam::codedFunctionObject::codeKeys() const
|
|||||||
"codeExecute",
|
"codeExecute",
|
||||||
"codeInclude",
|
"codeInclude",
|
||||||
"codeRead",
|
"codeRead",
|
||||||
|
"codeFields",
|
||||||
"codeWrite",
|
"codeWrite",
|
||||||
"localCode"
|
"localCode"
|
||||||
};
|
};
|
||||||
@ -152,6 +153,13 @@ Foam::functionObject& Foam::codedFunctionObject::redirectFunctionObject() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::codedFunctionObject::fields() const
|
||||||
|
{
|
||||||
|
updateLibrary();
|
||||||
|
return redirectFunctionObject().fields();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::codedFunctionObject::execute()
|
bool Foam::codedFunctionObject::execute()
|
||||||
{
|
{
|
||||||
updateLibrary();
|
updateLibrary();
|
||||||
|
|||||||
@ -35,6 +35,7 @@ Description
|
|||||||
codeData | c++; local member data (null constructed);
|
codeData | c++; local member data (null constructed);
|
||||||
localCode | c++; local static functions;
|
localCode | c++; local static functions;
|
||||||
codeRead | c++; upon functionObject::read();
|
codeRead | c++; upon functionObject::read();
|
||||||
|
codeFields | c++; upon functionObject::fields();
|
||||||
codeExecute | c++; upon functionObject::execute();
|
codeExecute | c++; upon functionObject::execute();
|
||||||
codeWrite | c++; upon functionObject::write()
|
codeWrite | c++; upon functionObject::write()
|
||||||
codeEnd | c++; upon functionObject::end();
|
codeEnd | c++; upon functionObject::end();
|
||||||
@ -137,6 +138,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Called at each ++ or += of the time-loop.
|
//- Called at each ++ or += of the time-loop.
|
||||||
// postProcess overrides the usual executeControl behaviour and
|
// postProcess overrides the usual executeControl behaviour and
|
||||||
// forces execution (used in post-processing mode)
|
// forces execution (used in post-processing mode)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -116,6 +116,12 @@ public:
|
|||||||
//- Read the removeRegisteredObject data
|
//- Read the removeRegisteredObject data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Remove the registered objects
|
//- Remove the registered objects
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -130,6 +130,12 @@ public:
|
|||||||
//- Read the controls
|
//- Read the controls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -102,6 +102,12 @@ public:
|
|||||||
//- Read and reset the timeStep Function1
|
//- Read and reset the timeStep Function1
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Reset the timeStep from the Function1 of time
|
//- Reset the timeStep from the Function1 of time
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -115,6 +115,12 @@ public:
|
|||||||
//- Read and reset the writeInterval Function1
|
//- Read and reset the writeInterval Function1
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Reset the writeInterval from the Function1 of time
|
//- Reset the writeInterval from the Function1 of time
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -121,6 +121,12 @@ public:
|
|||||||
//- Read the dictionary settings
|
//- Read the dictionary settings
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute, check existence of stopAt file and take action
|
//- Execute, check existence of stopAt file and take action
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -144,6 +144,12 @@ public:
|
|||||||
//- Read the system calls
|
//- Read the system calls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute the "executeCalls" at each time-step
|
//- Execute the "executeCalls" at each time-step
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -124,6 +124,12 @@ public:
|
|||||||
//- Read the controls
|
//- Read the controls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -131,6 +131,12 @@ public:
|
|||||||
//- Read the timeActivatedFileUpdate data
|
//- Read the timeActivatedFileUpdate data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute file updates
|
//- Execute file updates
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -109,6 +109,12 @@ public:
|
|||||||
//- Read the controls
|
//- Read the controls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -110,6 +110,12 @@ public:
|
|||||||
//- Read the writeDictionary data
|
//- Read the writeDictionary data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -160,6 +160,12 @@ public:
|
|||||||
//- Read the writeObjects data
|
//- Read the writeObjects data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Do nothing
|
//- Do nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -123,6 +123,12 @@ public:
|
|||||||
//- Read the rigidBodyState data
|
//- Read the rigidBodyState data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const
|
||||||
|
{
|
||||||
|
return wordList::null();
|
||||||
|
}
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -207,27 +207,6 @@ Foam::patchProbes::patchProbes
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::patchProbes::patchProbes
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const objectRegistry& obr,
|
|
||||||
const dictionary& dict,
|
|
||||||
const bool loadFromFiles
|
|
||||||
)
|
|
||||||
:
|
|
||||||
probes(name, obr, dict)
|
|
||||||
{
|
|
||||||
// When constructing probes above it will have called the
|
|
||||||
// probes::findElements (since the virtual mechanism not yet operating).
|
|
||||||
// Not easy to workaround (apart from feeding through flag into constructor)
|
|
||||||
// so clear out any cells found for now.
|
|
||||||
elementList_.clear();
|
|
||||||
faceList_.clear();
|
|
||||||
|
|
||||||
read(dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::patchProbes::~patchProbes()
|
Foam::patchProbes::~patchProbes()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -129,16 +129,6 @@ public:
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct for given objectRegistry and dictionary.
|
|
||||||
// Allow the possibility to load fields from files
|
|
||||||
patchProbes
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const objectRegistry&,
|
|
||||||
const dictionary&,
|
|
||||||
const bool loadFromFiles = false
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
//- Disallow default bitwise copy construction
|
||||||
patchProbes(const patchProbes&) = delete;
|
patchProbes(const patchProbes&) = delete;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -90,46 +90,24 @@ void Foam::patchProbes::sampleAndWrite
|
|||||||
{
|
{
|
||||||
forAll(fields, fieldi)
|
forAll(fields, fieldi)
|
||||||
{
|
{
|
||||||
if (loadFromFiles_)
|
objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
iter != objectRegistry::end()
|
||||||
|
&& iter()->type()
|
||||||
|
== GeometricField<Type, fvPatchField, volMesh>::typeName
|
||||||
|
)
|
||||||
{
|
{
|
||||||
sampleAndWrite
|
sampleAndWrite
|
||||||
(
|
(
|
||||||
GeometricField<Type, fvPatchField, volMesh>
|
mesh_.lookupObject
|
||||||
|
<GeometricField<Type, fvPatchField, volMesh>>
|
||||||
(
|
(
|
||||||
IOobject
|
fields[fieldi]
|
||||||
(
|
|
||||||
fields[fieldi],
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
mesh_
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
iter != objectRegistry::end()
|
|
||||||
&& iter()->type()
|
|
||||||
== GeometricField<Type, fvPatchField, volMesh>::typeName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
sampleAndWrite
|
|
||||||
(
|
|
||||||
mesh_.lookupObject
|
|
||||||
<GeometricField<Type, fvPatchField, volMesh>>
|
|
||||||
(
|
|
||||||
fields[fieldi]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,46 +120,24 @@ void Foam::patchProbes::sampleAndWriteSurfaceFields
|
|||||||
{
|
{
|
||||||
forAll(fields, fieldi)
|
forAll(fields, fieldi)
|
||||||
{
|
{
|
||||||
if (loadFromFiles_)
|
objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
iter != objectRegistry::end()
|
||||||
|
&& iter()->type()
|
||||||
|
== GeometricField<Type, fvsPatchField, surfaceMesh>::typeName
|
||||||
|
)
|
||||||
{
|
{
|
||||||
sampleAndWrite
|
sampleAndWrite
|
||||||
(
|
(
|
||||||
GeometricField<Type, fvsPatchField, surfaceMesh>
|
mesh_.lookupObject
|
||||||
|
<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||||
(
|
(
|
||||||
IOobject
|
fields[fieldi]
|
||||||
(
|
|
||||||
fields[fieldi],
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
mesh_
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
iter != objectRegistry::end()
|
|
||||||
&& iter()->type()
|
|
||||||
== GeometricField<Type, fvsPatchField, surfaceMesh>::typeName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
sampleAndWrite
|
|
||||||
(
|
|
||||||
mesh_.lookupObject
|
|
||||||
<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
|
||||||
(
|
|
||||||
fields[fieldi]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -279,28 +279,7 @@ Foam::probes::probes
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
loadFromFiles_(false),
|
fields_(),
|
||||||
fieldSelection_(),
|
|
||||||
fixedLocations_(true),
|
|
||||||
interpolationScheme_("cell")
|
|
||||||
{
|
|
||||||
read(dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::probes::probes
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const objectRegistry& obr,
|
|
||||||
const dictionary& dict,
|
|
||||||
const bool loadFromFiles
|
|
||||||
)
|
|
||||||
:
|
|
||||||
functionObject(name),
|
|
||||||
pointField(0),
|
|
||||||
mesh_(refCast<const fvMesh>(obr)),
|
|
||||||
loadFromFiles_(loadFromFiles),
|
|
||||||
fieldSelection_(),
|
|
||||||
fixedLocations_(true),
|
fixedLocations_(true),
|
||||||
interpolationScheme_("cell")
|
interpolationScheme_("cell")
|
||||||
{
|
{
|
||||||
@ -319,7 +298,7 @@ Foam::probes::~probes()
|
|||||||
bool Foam::probes::read(const dictionary& dict)
|
bool Foam::probes::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
dict.lookup("probeLocations") >> *this;
|
dict.lookup("probeLocations") >> *this;
|
||||||
dict.lookup("fields") >> fieldSelection_;
|
dict.lookup("fields") >> fields_;
|
||||||
|
|
||||||
dict.readIfPresent("fixedLocations", fixedLocations_);
|
dict.readIfPresent("fixedLocations", fixedLocations_);
|
||||||
if (dict.readIfPresent("interpolationScheme", interpolationScheme_))
|
if (dict.readIfPresent("interpolationScheme", interpolationScheme_))
|
||||||
@ -342,6 +321,12 @@ bool Foam::probes::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::probes::fields() const
|
||||||
|
{
|
||||||
|
return fields_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::probes::execute()
|
bool Foam::probes::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -45,7 +45,6 @@ SourceFiles
|
|||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "surfaceFieldsFwd.H"
|
#include "surfaceFieldsFwd.H"
|
||||||
#include "surfaceMesh.H"
|
#include "surfaceMesh.H"
|
||||||
#include "wordReList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -92,14 +91,11 @@ protected:
|
|||||||
//- Const reference to fvMesh
|
//- Const reference to fvMesh
|
||||||
const fvMesh& mesh_;
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
//- Load fields from files (not from objectRegistry)
|
|
||||||
bool loadFromFiles_;
|
|
||||||
|
|
||||||
|
|
||||||
// Read from dictonary
|
// Read from dictonary
|
||||||
|
|
||||||
//- Names of fields to probe
|
//- Names of fields to probe
|
||||||
wordReList fieldSelection_;
|
wordList fields_;
|
||||||
|
|
||||||
//- Fixed locations, default = yes
|
//- Fixed locations, default = yes
|
||||||
// Note: set to false for moving mesh calculations where locations
|
// Note: set to false for moving mesh calculations where locations
|
||||||
@ -198,16 +194,6 @@ public:
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct for given objectRegistry and dictionary.
|
|
||||||
// Allow the possibility to load fields from files
|
|
||||||
probes
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const objectRegistry& obr,
|
|
||||||
const dictionary& dict,
|
|
||||||
const bool loadFromFiles = false
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
//- Disallow default bitwise copy construction
|
||||||
probes(const probes&) = delete;
|
probes(const probes&) = delete;
|
||||||
|
|
||||||
@ -218,11 +204,8 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return names of fields to probe
|
//- Return the list of fields required
|
||||||
virtual const wordReList& fieldNames() const
|
virtual wordList fields() const;
|
||||||
{
|
|
||||||
return fieldSelection_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return locations to probe
|
//- Return locations to probe
|
||||||
virtual const pointField& probeLocations() const
|
virtual const pointField& probeLocations() const
|
||||||
|
|||||||
@ -113,35 +113,13 @@ Foam::label Foam::probes::classifyFields()
|
|||||||
label nFields = 0;
|
label nFields = 0;
|
||||||
clearFieldGroups();
|
clearFieldGroups();
|
||||||
|
|
||||||
if (loadFromFiles_ || postProcess)
|
// Check currently available fields
|
||||||
|
forAll(fields_, fieldi)
|
||||||
{
|
{
|
||||||
// check files for a particular time
|
const word& fieldName = fields_[fieldi];
|
||||||
IOobjectList objects(mesh_, mesh_.time().timeName());
|
|
||||||
wordList allFields = objects.sortedNames();
|
|
||||||
|
|
||||||
labelList indices = findStrings(fieldSelection_, allFields);
|
if (mesh_.objectRegistry::found(fieldName))
|
||||||
|
|
||||||
forAll(indices, fieldi)
|
|
||||||
{
|
{
|
||||||
const word& fieldName = allFields[indices[fieldi]];
|
|
||||||
|
|
||||||
nFields += appendFieldGroup
|
|
||||||
(
|
|
||||||
fieldName,
|
|
||||||
objects.find(fieldName)()->headerClassName()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// check currently available fields
|
|
||||||
wordList allFields = mesh_.sortedNames();
|
|
||||||
labelList indices = findStrings(fieldSelection_, allFields);
|
|
||||||
|
|
||||||
forAll(indices, fieldi)
|
|
||||||
{
|
|
||||||
const word& fieldName = allFields[indices[fieldi]];
|
|
||||||
|
|
||||||
nFields += appendFieldGroup
|
nFields += appendFieldGroup
|
||||||
(
|
(
|
||||||
fieldName,
|
fieldName,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -120,46 +120,24 @@ void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields)
|
|||||||
{
|
{
|
||||||
forAll(fields, fieldi)
|
forAll(fields, fieldi)
|
||||||
{
|
{
|
||||||
if (loadFromFiles_)
|
objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
iter != objectRegistry::end()
|
||||||
|
&& iter()->type()
|
||||||
|
== GeometricField<Type, fvPatchField, volMesh>::typeName
|
||||||
|
)
|
||||||
{
|
{
|
||||||
sampleAndWrite
|
sampleAndWrite
|
||||||
(
|
(
|
||||||
GeometricField<Type, fvPatchField, volMesh>
|
mesh_.lookupObject
|
||||||
|
<GeometricField<Type, fvPatchField, volMesh>>
|
||||||
(
|
(
|
||||||
IOobject
|
fields[fieldi]
|
||||||
(
|
|
||||||
fields[fieldi],
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
mesh_
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
iter != objectRegistry::end()
|
|
||||||
&& iter()->type()
|
|
||||||
== GeometricField<Type, fvPatchField, volMesh>::typeName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
sampleAndWrite
|
|
||||||
(
|
|
||||||
mesh_.lookupObject
|
|
||||||
<GeometricField<Type, fvPatchField, volMesh>>
|
|
||||||
(
|
|
||||||
fields[fieldi]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,49 +147,28 @@ void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields)
|
|||||||
{
|
{
|
||||||
forAll(fields, fieldi)
|
forAll(fields, fieldi)
|
||||||
{
|
{
|
||||||
if (loadFromFiles_)
|
objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
iter != objectRegistry::end()
|
||||||
|
&& iter()->type()
|
||||||
|
== GeometricField<Type, fvsPatchField, surfaceMesh>::typeName
|
||||||
|
)
|
||||||
{
|
{
|
||||||
sampleAndWrite
|
sampleAndWrite
|
||||||
(
|
(
|
||||||
GeometricField<Type, fvsPatchField, surfaceMesh>
|
mesh_.lookupObject
|
||||||
|
<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||||
(
|
(
|
||||||
IOobject
|
fields[fieldi]
|
||||||
(
|
|
||||||
fields[fieldi],
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
mesh_
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
iter != objectRegistry::end()
|
|
||||||
&& iter()->type()
|
|
||||||
== GeometricField<Type, fvsPatchField, surfaceMesh>::typeName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
sampleAndWrite
|
|
||||||
(
|
|
||||||
mesh_.lookupObject
|
|
||||||
<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
|
||||||
(
|
|
||||||
fields[fieldi]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
|||||||
@ -158,36 +158,6 @@ Foam::sampledSets::sampledSets
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
loadFromFiles_(false),
|
|
||||||
outputPath_(fileName::null),
|
|
||||||
searchEngine_(mesh_),
|
|
||||||
interpolationScheme_(word::null),
|
|
||||||
writeFormat_(word::null)
|
|
||||||
{
|
|
||||||
outputPath_ =
|
|
||||||
mesh_.time().globalPath()/functionObjects::writeFile::outputPrefix/name;
|
|
||||||
|
|
||||||
if (mesh_.name() != fvMesh::defaultRegion)
|
|
||||||
{
|
|
||||||
outputPath_ = outputPath_/mesh_.name();
|
|
||||||
}
|
|
||||||
|
|
||||||
read(dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::sampledSets::sampledSets
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const objectRegistry& obr,
|
|
||||||
const dictionary& dict,
|
|
||||||
const bool loadFromFiles
|
|
||||||
)
|
|
||||||
:
|
|
||||||
functionObject(name),
|
|
||||||
PtrList<sampledSet>(),
|
|
||||||
mesh_(refCast<const fvMesh>(obr)),
|
|
||||||
loadFromFiles_(loadFromFiles),
|
|
||||||
outputPath_(fileName::null),
|
outputPath_(fileName::null),
|
||||||
searchEngine_(mesh_),
|
searchEngine_(mesh_),
|
||||||
interpolationScheme_(word::null),
|
interpolationScheme_(word::null),
|
||||||
@ -219,6 +189,12 @@ void Foam::sampledSets::verbose(const bool verbosity)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordList Foam::sampledSets::fields() const
|
||||||
|
{
|
||||||
|
return fields_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::sampledSets::execute()
|
bool Foam::sampledSets::execute()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@ -277,7 +253,7 @@ bool Foam::sampledSets::read(const dictionary& dict)
|
|||||||
bool setsFound = dict_.found("sets");
|
bool setsFound = dict_.found("sets");
|
||||||
if (setsFound)
|
if (setsFound)
|
||||||
{
|
{
|
||||||
dict_.lookup("fields") >> fieldSelection_;
|
dict_.lookup("fields") >> fields_;
|
||||||
clearFieldGroups();
|
clearFieldGroups();
|
||||||
|
|
||||||
dict.lookup("interpolationScheme") >> interpolationScheme_;
|
dict.lookup("interpolationScheme") >> interpolationScheme_;
|
||||||
@ -304,7 +280,7 @@ bool Foam::sampledSets::read(const dictionary& dict)
|
|||||||
|
|
||||||
if (Pstream::master() && debug)
|
if (Pstream::master() && debug)
|
||||||
{
|
{
|
||||||
Pout<< "sample fields:" << fieldSelection_ << nl
|
Pout<< "sample fields:" << fields_ << nl
|
||||||
<< "sample sets:" << nl << "(" << nl;
|
<< "sample sets:" << nl << "(" << nl;
|
||||||
|
|
||||||
forAll(*this, setI)
|
forAll(*this, setI)
|
||||||
|
|||||||
@ -176,7 +176,7 @@ class sampledSets
|
|||||||
// Read from dictonary
|
// Read from dictonary
|
||||||
|
|
||||||
//- Names of fields to sample
|
//- Names of fields to sample
|
||||||
wordReList fieldSelection_;
|
wordList fields_;
|
||||||
|
|
||||||
//- Interpolation scheme to use
|
//- Interpolation scheme to use
|
||||||
word interpolationScheme_;
|
word interpolationScheme_;
|
||||||
@ -259,16 +259,6 @@ public:
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct for given objectRegistry and dictionary
|
|
||||||
// allow the possibility to load fields from files
|
|
||||||
sampledSets
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const objectRegistry&,
|
|
||||||
const dictionary&,
|
|
||||||
const bool loadFromFiles = false
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
//- Disallow default bitwise copy construction
|
||||||
sampledSets(const sampledSets&) = delete;
|
sampledSets(const sampledSets&) = delete;
|
||||||
|
|
||||||
@ -285,6 +275,9 @@ public:
|
|||||||
//- Read the sampledSets
|
//- Read the sampledSets
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Execute, currently does nothing
|
//- Execute, currently does nothing
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -81,66 +81,24 @@ Foam::label Foam::sampledSets::classifyFields()
|
|||||||
label nFields = 0;
|
label nFields = 0;
|
||||||
clearFieldGroups();
|
clearFieldGroups();
|
||||||
|
|
||||||
if (loadFromFiles_)
|
// Check currently available fields
|
||||||
|
forAll(fields_, fieldi)
|
||||||
{
|
{
|
||||||
// Check files for a particular time
|
const word& fieldName = fields_[fieldi];
|
||||||
IOobjectList objects(mesh_, mesh_.time().timeName());
|
|
||||||
wordList allFields = objects.sortedNames();
|
|
||||||
|
|
||||||
forAll(fieldSelection_, i)
|
if (mesh_.objectRegistry::found(fieldName))
|
||||||
{
|
{
|
||||||
labelList indices = findStrings(fieldSelection_[i], allFields);
|
nFields += appendFieldGroup
|
||||||
|
(
|
||||||
if (indices.size())
|
fieldName,
|
||||||
{
|
mesh_.find(fieldName)()->type()
|
||||||
forAll(indices, fieldi)
|
);
|
||||||
{
|
|
||||||
const word& fieldName = allFields[indices[fieldi]];
|
|
||||||
|
|
||||||
nFields += appendFieldGroup
|
|
||||||
(
|
|
||||||
fieldName,
|
|
||||||
objects.find(fieldName)()->headerClassName()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WarningInFunction
|
|
||||||
<< "Cannot find field file matching "
|
|
||||||
<< fieldSelection_[i] << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
|
||||||
// Check currently available fields
|
|
||||||
wordList allFields = mesh_.sortedNames();
|
|
||||||
labelList indices = findStrings(fieldSelection_, allFields);
|
|
||||||
|
|
||||||
forAll(fieldSelection_, i)
|
|
||||||
{
|
{
|
||||||
labelList indices = findStrings(fieldSelection_[i], allFields);
|
WarningInFunction
|
||||||
|
<< "Cannot find registered field matching "
|
||||||
if (indices.size())
|
<< fieldName << endl;
|
||||||
{
|
|
||||||
forAll(indices, fieldi)
|
|
||||||
{
|
|
||||||
const word& fieldName = allFields[indices[fieldi]];
|
|
||||||
|
|
||||||
nFields += appendFieldGroup
|
|
||||||
(
|
|
||||||
fieldName,
|
|
||||||
mesh_.find(fieldName)()->type()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WarningInFunction
|
|
||||||
<< "Cannot find registered field matching "
|
|
||||||
<< fieldSelection_[i] << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -243,75 +243,34 @@ void Foam::sampledSets::sampleAndWrite
|
|||||||
<< fields[fieldi] << endl;
|
<< fields[fieldi] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loadFromFiles_)
|
if (interpolate)
|
||||||
{
|
{
|
||||||
GeometricField<Type, fvPatchField, volMesh> vf
|
sampledFields.set
|
||||||
(
|
(
|
||||||
IOobject
|
fieldi,
|
||||||
|
new volFieldSampler<Type>
|
||||||
(
|
(
|
||||||
fields[fieldi],
|
interpolationScheme_,
|
||||||
mesh_.time().timeName(),
|
mesh_.lookupObject
|
||||||
mesh_,
|
<GeometricField<Type, fvPatchField, volMesh>>
|
||||||
IOobject::MUST_READ,
|
(fields[fieldi]),
|
||||||
IOobject::NO_WRITE,
|
*this
|
||||||
false
|
)
|
||||||
),
|
|
||||||
mesh_
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (interpolate)
|
|
||||||
{
|
|
||||||
sampledFields.set
|
|
||||||
(
|
|
||||||
fieldi,
|
|
||||||
new volFieldSampler<Type>
|
|
||||||
(
|
|
||||||
interpolationScheme_,
|
|
||||||
vf,
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sampledFields.set
|
|
||||||
(
|
|
||||||
fieldi,
|
|
||||||
new volFieldSampler<Type>(vf, *this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (interpolate)
|
sampledFields.set
|
||||||
{
|
(
|
||||||
sampledFields.set
|
fieldi,
|
||||||
|
new volFieldSampler<Type>
|
||||||
(
|
(
|
||||||
fieldi,
|
mesh_.lookupObject
|
||||||
new volFieldSampler<Type>
|
<GeometricField<Type, fvPatchField, volMesh>>
|
||||||
(
|
(fields[fieldi]),
|
||||||
interpolationScheme_,
|
*this
|
||||||
mesh_.lookupObject
|
)
|
||||||
<GeometricField<Type, fvPatchField, volMesh>>
|
);
|
||||||
(fields[fieldi]),
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sampledFields.set
|
|
||||||
(
|
|
||||||
fieldi,
|
|
||||||
new volFieldSampler<Type>
|
|
||||||
(
|
|
||||||
mesh_.lookupObject
|
|
||||||
<GeometricField<Type, fvPatchField, volMesh>>
|
|
||||||
(fields[fieldi]),
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -268,6 +268,12 @@ Foam::sampledSurfaces::isoSurface::~isoSurface()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::wordList Foam::sampledSurfaces::isoSurface::fields() const
|
||||||
|
{
|
||||||
|
return wordList(isoField_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::sampledSurfaces::isoSurface::needsUpdate() const
|
bool Foam::sampledSurfaces::isoSurface::needsUpdate() const
|
||||||
{
|
{
|
||||||
const fvMesh& fvm = static_cast<const fvMesh&>(mesh());
|
const fvMesh& fvm = static_cast<const fvMesh&>(mesh());
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -142,6 +142,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the list of fields required
|
||||||
|
virtual wordList fields() const;
|
||||||
|
|
||||||
//- Does the surface need an update?
|
//- Does the surface need an update?
|
||||||
virtual bool needsUpdate() const;
|
virtual bool needsUpdate() const;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user