85 typename dictionaryConstructorTable::iterator cstrIter =
86 dictionaryConstructorTablePtr_->find(averageType);
88 if (cstrIter == dictionaryConstructorTablePtr_->end())
92 "Foam::AveragingMethod<Type>::New" 98 ) <<
"Unknown averaging method " << averageType
99 <<
", constructor not in hash table" <<
nl <<
nl 100 <<
" Valid averaging methods are:" <<
nl 101 << dictionaryConstructorTablePtr_->sortedToc()
142 *
this /=
max(weight, SMALL);
166 this->
name() +
":cellValue",
177 this->
name() +
":cellGrad",
188 this->
name() +
":pointValue",
199 this->
name() +
":pointGrad",
211 polyMeshTetDecomposition::cellTetIndices(mesh_, cellI);
216 const scalar v = tetIs.
tet(mesh_).
mag();
218 cellValue[cellI] += v*
interpolate(mesh_.C()[cellI], tetIs);
219 cellGrad[cellI] += v*interpolateGrad(mesh_.C()[cellI], tetIs);
221 const face&
f = mesh_.faces()[tetIs.
face()];
224 vertices[1] = f[tetIs.
facePtA()];
225 vertices[2] = f[tetIs.
facePtB()];
229 const label pointI = vertices[vertexI];
231 pointVolume[pointI] += v;
232 pointValue[pointI] +=
235 v*interpolateGrad(mesh_.points()[pointI], tetIs);
241 cellValue.internalField() /= mesh_.V();
247 if (!cellValue.write())
return false;
248 if (!cellGrad.
write())
return false;
249 if (!pointValue.
write())
return false;
250 if (!pointGrad.
write())
return false;
static autoPtr< AveragingMethod< Type > > New(const IOobject &io, const dictionary &dict, const fvMesh &mesh)
Selector.
Mesh data needed to do the Finite Volume discretisation.
word name(const complex &)
Return a string representation of a complex.
label faceBasePt() const
Return the face base point.
virtual ~AveragingMethod()
Destructor.
Macros to ease declaration of run-time selection tables.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
InternalField & internalField()
Return internal field.
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Mesh representing a set of points created from polyMesh.
A list of keyword definitions, which are a keyword followed by any number of values (e...
scalar mag() const
Return volume.
tetPointRef tet(const polyMesh &mesh) const
Return the geometry corresponding to this tet from the.
virtual bool write() const
Write using setting from DB.
AveragingMethod(const IOobject &io, const dictionary &dict, const fvMesh &mesh, const labelList &size)
Constructors.
A face is a list of labels corresponding to mesh vertices.
Generic dimensioned Type class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual void updateGrad()
Protected member functions.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
bool good() const
Return true if next operation might succeed.
virtual void average()
Calculate the average.
Pre-declare SubField and related Field type.
errorManip< error > abort(error &err)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Generic GeometricField class.
Traits class for primitives.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual bool writeData(Ostream &) const
Dummy write.
const fvMesh & mesh_
The mesh on which the averaging is to be done.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Base class for lagrangian averaging methods.
label facePtA() const
Return face point A.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
const dictionary & dict_
Protected data.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual bool write() const
Write using setting from DB.
label facePtB() const
Return face point B.
label face() const
Return the face.