85 typename dictionaryConstructorTable::iterator cstrIter =
86 dictionaryConstructorTablePtr_->find(averageType);
88 if (cstrIter == dictionaryConstructorTablePtr_->end())
91 <<
"Unknown averaging method " << averageType
92 <<
", constructor not in hash table" <<
nl <<
nl 93 <<
" Valid averaging methods are:" <<
nl 94 << dictionaryConstructorTablePtr_->sortedToc()
135 *
this /=
max(weight, SMALL);
159 this->
name() +
":cellValue",
170 this->
name() +
":cellGrad",
181 this->
name() +
":pointValue",
192 this->
name() +
":pointGrad",
204 polyMeshTetDecomposition::cellTetIndices(mesh_, celli);
209 const scalar v = tetIs.
tet(mesh_).
mag();
211 cellValue[celli] += v*
interpolate(mesh_.C()[celli], tetIs);
212 cellGrad[celli] += v*interpolateGrad(mesh_.C()[celli], tetIs);
214 const face&
f = mesh_.faces()[tetIs.
face()];
217 vertices[1] = f[tetIs.
facePtA()];
218 vertices[2] = f[tetIs.
facePtB()];
222 const label pointi = vertices[vertexI];
224 pointVolume[pointi] += v;
225 pointValue[pointi] +=
228 v*interpolateGrad(mesh_.points()[pointi], tetIs);
234 cellValue.primitiveFieldRef() /= mesh_.V();
240 if (!cellValue.write())
return false;
241 if (!cellGrad.
write())
return false;
242 if (!pointValue.
write())
return false;
243 if (!pointGrad.
write())
return false;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label facePtA() const
Return face point A.
static autoPtr< AveragingMethod< Type > > New(const IOobject &io, const dictionary &dict, const fvMesh &mesh)
Selector.
A face is a list of labels corresponding to mesh vertices.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool good() const
Return true if next operation might succeed.
Generic GeometricField class.
Generic dimensioned Type class.
tmp< surfaceScalarField > interpolate(const RhoType &rho)
label faceBasePt() const
Return the face base point.
Mesh representing a set of points created from polyMesh.
virtual bool write() const
Write using setting from DB.
label facePtB() const
Return face point B.
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
Base class for lagrangian averaging methods.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
label face() const
Return the face.
errorManip< error > abort(error &err)
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...
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const dictionary & dict_
Protected data.
scalar mag() const
Return volume.
virtual void updateGrad()
Protected member functions.
word name(const complex &)
Return a string representation of a complex.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
virtual void average()
Calculate the average.
Mesh data needed to do the Finite Volume discretisation.
virtual bool write() const
Write using setting from DB.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Macros to ease declaration of run-time selection tables.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
AveragingMethod(const IOobject &io, const dictionary &dict, const fvMesh &mesh, const labelList &size)
Constructors.
tetPointRef tet(const polyMesh &mesh) const
Return the geometry corresponding to this tet from the.
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.
virtual ~AveragingMethod()
Destructor.