69 const AveragingMethod<Type>& am
73 FieldField<Field, Type>(am),
95 auto* ctorPtr = dictionaryConstructorTable(modelType);
104 *dictionaryConstructorTablePtr_
129 *
this /=
max(weight, SMALL);
156 auto& cellValue = tcellValue.ref();
165 auto& cellGrad = tcellGrad.ref();
174 auto& pointValue = tpointValue.ref();
183 auto& pointGrad = tpointGrad.ref();
207 cellValue[celli] += v*
interpolate(tetCrds[0], tetIs);
212 const label pointi = triIs[vertexI];
214 pointVolume[pointi] += v;
215 pointValue[pointi] += v*
interpolate(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;
Base class for lagrangian averaging methods.
const fvMesh & mesh_
The mesh on which the averaging is to be done.
virtual bool writeData(Ostream &) const
Dummy write.
virtual TypeGrad interpolateGrad(const barycentric &coordinates, const tetIndices &tetIs) const=0
AveragingMethod(const IOobject &io, const dictionary &dict, const fvMesh &mesh, const labelList &size)
Constructors.
static autoPtr< AveragingMethod< Type > > New(const IOobject &io, const dictionary &dict, const fvMesh &mesh)
Selector.
const dictionary & dict_
Protected data.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual void updateGrad()
Protected member functions.
virtual void average()
Calculate the average.
A field of fields is a PtrList of fields with reference counting.
constexpr FieldField() noexcept
Construct null.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A 1D vector of objects of type <T> with a fixed length <N>.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
@ NO_REGISTER
Do not request registration (bool: false).
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void append(Field< Type > *ptr)
label size() const noexcept
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
Mesh representing a set of points created from polyMesh.
static List< tetIndices > cellTetIndices(const polyMesh &mesh, label cI)
Return the tet decomposition of the given cell, see.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
triFace faceTriIs(const polyMesh &mesh, const bool warn=true) const
The indices corresponding to the tri on the face for this tet. The normal of the tri points out of th...
tetPointRef tet(const polyMesh &mesh) const
The tet geometry for this tet, where point0 is the cell centre.
scalar mag() const
Return volume.
A triangular face using a FixedList of labels corresponding to mesh vertices.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
List< label > labelList
A List of labels.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
errorManip< error > abort(error &err)
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).
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
Macros to ease declaration of run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.