69 const AveragingMethod<Type>& am
73 FieldField<Field, Type>(am),
92 dict.template getOrDefault<word>(typeName,
"basic")
95 auto* ctorPtr = dictionaryConstructorTable(modelType);
104 *dictionaryConstructorTablePtr_
129 *
this /=
max(weight, SMALL);
151 IOobject::scopedName(this->
name(),
"cellValue"),
152 IOobject::NO_REGISTER,
156 auto& cellValue = tcellValue.ref();
160 IOobject::scopedName(this->
name(),
"cellGrad"),
161 IOobject::NO_REGISTER,
165 auto& cellGrad = tcellGrad.ref();
169 IOobject::scopedName(this->
name(),
"pointValue"),
170 IOobject::NO_REGISTER,
174 auto& pointValue = tpointValue.ref();
178 IOobject::scopedName(this->
name(),
"pointGrad"),
179 IOobject::NO_REGISTER,
183 auto& pointGrad = tpointGrad.ref();
198 const List<tetIndices> cellTets =
199 polyMeshTetDecomposition::cellTetIndices(mesh_, celli);
203 const tetIndices& tetIs = cellTets[tetI];
204 const triFace triIs = tetIs.faceTriIs(mesh_);
205 const scalar v = tetIs.tet(mesh_).mag();
207 cellValue[celli] += v*
interpolate(tetCrds[0], tetIs);
208 cellGrad[celli] += v*interpolateGrad(tetCrds[0], tetIs);
212 const label pointi = triIs[vertexI];
214 pointVolume[pointi] += v;
215 pointValue[pointi] += v*
interpolate(tetCrds[vertexI], tetIs);
216 pointGrad[pointi] += v*interpolateGrad(tetCrds[vertexI], tetIs);
222 cellValue.primitiveFieldRef() /= mesh_.V();
223 cellGrad.primitiveFieldRef() /= mesh_.V();
224 pointValue.primitiveFieldRef() /= pointVolume;
225 pointGrad.primitiveFieldRef() /= pointVolume;
228 if (!cellValue.write(writeOnProc))
return false;
229 if (!cellGrad.write(writeOnProc))
return false;
230 if (!pointValue.write(writeOnProc))
return false;
231 if (!pointGrad.write(writeOnProc))
return false;
static autoPtr< AveragingMethod< Type > > New(const IOobject &io, const dictionary &dict, const fvMesh &mesh)
Selector.
A 1D vector of objects of type <T> with a fixed length <N>.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Generic dimensioned Type class.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
const dimensionSet dimless
Dimensionless.
A field of fields is a PtrList of fields with reference counting.
Mesh representing a set of points created from polyMesh.
#define forAll(list, i)
Loop across all elements in list.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Generic templated field type.
A class for handling words, derived from Foam::string.
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
virtual void updateGrad()
Protected member functions.
virtual bool writeData(Ostream &) const
Dummy write.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
virtual void average()
Calculate the average.
Mesh data needed to do the Finite Volume discretisation.
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.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Macros to ease declaration of run-time selection tables.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
AveragingMethod(const IOobject &io, const dictionary &dict, const fvMesh &mesh, const labelList &size)
Constructors.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)