94 typename dictionaryConstructorTable::iterator cstrIter =
95 dictionaryConstructorTablePtr_->find(averageType);
97 if (cstrIter == dictionaryConstructorTablePtr_->end())
100 <<
"Unknown averaging method " << averageType
101 <<
", constructor not in hash table" <<
nl <<
nl
102 <<
" Valid averaging methods are:" <<
nl
103 << dictionaryConstructorTablePtr_->sortedToc()
135 *
this /=
max(weight, small);
170 this->
name() +
":cellGrad",
181 this->
name() +
":pointValue",
192 this->
name() +
":pointGrad",
220 const scalar v = tetIs.
tet(mesh_).
mag();
222 cellValue[celli] += v*
interpolate(tetCrds[0], tetIs);
223 cellGrad[celli] += v*interpolateGrad(tetCrds[0], tetIs);
227 const label pointi = triIs[vertexI];
229 pointVolume[pointi] += v;
230 pointValue[pointi] += v*
interpolate(tetCrds[vertexI], tetIs);
231 pointGrad[pointi] += v*interpolateGrad(tetCrds[vertexI], tetIs);
237 cellValue.primitiveFieldRef() /= mesh_.V();
238 cellGrad.primitiveFieldRef() /= mesh_.V();
239 pointValue.primitiveFieldRef() /= pointVolume;
240 pointGrad.primitiveFieldRef() /= pointVolume;
243 if (!cellValue.write(
write))
return false;
244 if (!cellGrad.write(
write))
return false;
245 if (!pointValue.write(
write))
return false;
246 if (!pointGrad.write(
write))
return false;
#define forAll(list, i)
Loop across all elements in list.
Base class for lagrangian averaging methods.
virtual bool writeData(Ostream &) const
Dummy write.
AveragingMethod(const IOobject &io, const dictionary &dict, const fvMesh &mesh, const labelList &size)
Constructors.
virtual ~AveragingMethod()
Destructor.
static autoPtr< AveragingMethod< Type > > New(const IOobject &io, const dictionary &dict, const fvMesh &mesh)
Selector.
virtual bool write(const bool write=true) const
Write using setting from DB.
virtual void updateGrad()
Protected member functions.
virtual void average()
Calculate the average.
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Pre-declare SubField and related Field type.
A 1D vector of objects of type <T> with a fixed size <Size>.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
bool good() const
Return true if next operation might succeed.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void append(Field< Type > *)
Append an element at the end of the list.
label size() const
Return the number of elements in the UPtrList.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
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...
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
Return the indices corresponding to the tri on the face for.
tetPointRef tet(const polyMesh &mesh) const
Return the geometry corresponding to this tet.
scalar mag() const
Return volume.
A triangular face using a FixedList of labels corresponding to mesh vertices.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
const dimensionSet dimless
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Macros to ease declaration of run-time selection tables.