35 bool Foam::functionObjects::columnAverage::columnAverageField
40 typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
42 const fieldType* fldPtr = cfindObject<fieldType>(fieldName);
46 const fieldType&
fld = *fldPtr;
48 const word resultName(averageName(fieldName));
54 resPtr =
new fieldType
59 fld.mesh().time().timeName(),
69 fieldType& res = *resPtr;
71 const meshStructure& ms = meshAddressing(
fld.mesh());
72 if (globalFaces_().empty())
77 const labelList& cellToPatchFace = ms.cellToPatchFaceAddressing();
80 Field<Type> regionField(globalFaces_().totalSize(),
Zero);
83 forAll(cellToPatchFace, celli)
85 const label regioni = cellToPatchFace[celli];
86 regionField[regioni] +=
fld[celli];
87 regionCount[regioni]++;
94 forAll(regionField, regioni)
96 regionField[regioni] /= regionCount[regioni];
100 forAll(cellToPatchFace, celli)
102 const label regioni = cellToPatchFace[celli];
103 res[celli] = regionField[regioni];
105 res.correctBoundaryConditions();
bool store()
Register object with its registry and transfer ownership to the registry.
Ignore writing from objectRegistry::writeObject()
#define forAll(list, i)
Loop across all elements in list.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const objectRegistry & obr_
Reference to the region objectRegistry.
List< label > labelList
A List of labels.
Request registration (bool: true)
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Combines List elements. After completion all processors have the same data.
static constexpr const zero Zero
Global zero (0)