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);
159 this->
name() +
":cellValue",
170 this->
name() +
":cellGrad",
181 this->
name() +
":pointValue",
192 this->
name() +
":pointGrad",
214 polyMeshTetDecomposition::cellTetIndices(mesh_, celli);
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();
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.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
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 size <Size>.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Generic GeometricField class.
const dimensionSet dimless
Generic dimensioned Type class.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
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.
bool good() const
Return true if next operation might succeed.
Mesh representing a set of points created from polyMesh.
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
A triangular face using a FixedList of labels corresponding to mesh vertices.
scalar mag() const
Return volume.
Base class for lagrangian averaging methods.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
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.
virtual bool write(const bool write=true) const
Write using setting from DB.
virtual void updateGrad()
Protected member functions.
word name(const complex &)
Return a string representation of a complex.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
virtual bool writeData(Ostream &) const
Dummy write.
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...
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.
virtual bool write(const bool write=true) const
Write using setting from DB.
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.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual ~AveragingMethod()
Destructor.