49Foam::functionObjects::columnAverage::meshAddressing(
const polyMesh&
mesh)
const
51 if (!meshStructurePtr_)
57 for (
const label patchi : patchIDs_)
59 sz +=
pbm[patchi].size();
65 for (
const label patchi : patchIDs_)
67 label start =
pbm[patchi].start();
68 label size =
pbm[patchi].size();
69 for (label i = 0; i < size; ++i)
71 meshFaces[sz++] = start+i;
81 <<
"Requested patches have zero faces"
87 UIndirectList<face>(
mesh.faces(), meshFaces),
91 globalFaces_.reset(
new globalIndex(uip.size()));
92 globalEdges_.reset(
new globalIndex(uip.nEdges()));
93 globalPoints_.reset(
new globalIndex(uip.nPoints()));
94 meshStructurePtr_.reset
107 return *meshStructurePtr_;
111const Foam::word Foam::functionObjects::columnAverage::averageName
113 const word& fieldName
116 return scopedName(
"columnAverage(" + fieldName +
")");
144 mesh_.boundaryMesh().patchSet
149 fieldSet_.read(
dict);
158 fieldSet_.updateSelection();
160 for (
const word& fieldName : fieldSet_.selectionNames())
162 columnAverageField<scalar>(fieldName);
163 columnAverageField<vector>(fieldName);
164 columnAverageField<sphericalTensor>(fieldName);
165 columnAverageField<symmTensor>(fieldName);
166 columnAverageField<tensor>(fieldName);
175 for (
const word& fieldName : fieldSet_.selectionNames())
178 obr_.cfindObject<
regIOobject>(averageName(fieldName));
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const polyBoundaryMesh & pbm
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
word scopedName(const word &name) const
Return a scoped (prefixed) name.
Computes the arithmetic average of given quantities along columns of cells in a given direction for s...
columnAverage(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
const objectRegistry & obr_
Reference to the region objectRegistry.
Detect extruded mesh structure given a set of faces (uindirectPrimitivePatch).
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
Mesh consisting of general polyhedral cells.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
bool read(const char *buf, int32_t &val)
Same as readInt32.
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.