38 s()[0] = mesh.nCells();
39 s()[1] = mesh.nPoints();
55 volumeCell_(mesh.V()),
56 volumeDual_(mesh.nPoints(), 0.0),
62 forAll(this->mesh_.C(), celli)
65 polyMeshTetDecomposition::cellTetIndices(this->mesh_, celli);
69 const face&
f = this->mesh_.faces()[tetIs.
face()];
70 const scalar v = tetIs.
tet(this->mesh_).
mag();
72 volumeDual_[f[tetIs.
facePtA()]] += v;
73 volumeDual_[f[tetIs.
facePtB()]] += v;
77 mesh.globalData().syncPointData
93 volumeCell_(am.volumeCell_),
94 volumeDual_(am.volumeDual_),
97 tetVertices_(am.tetVertices_),
98 tetCoordinates_(am.tetCoordinates_)
114 const point position,
118 const face&
f = this->mesh_.faces()[tetIs.
face()];
121 tetVertices_[1] = f[tetIs.
facePtA()];
122 tetVertices_[2] = f[tetIs.
facePtB()];
126 tetCoordinates_ =
max(tetCoordinates_, scalar(0));
133 this->mesh_.globalData().syncPointData
147 const point position,
152 tetGeometry(position, tetIs);
154 dataCell_[tetIs.
cell()] +=
155 tetCoordinates_[0]*value
156 / (0.25*volumeCell_[tetIs.
cell()]);
158 for(
label i = 0; i < 3; i ++)
160 dataDual_[tetVertices_[i]] +=
161 tetCoordinates_[i+1]*value
162 / (0.25*volumeDual_[tetVertices_[i]]);
170 const point position,
174 tetGeometry(position, tetIs);
177 tetCoordinates_[0]*dataCell_[tetIs.
cell()]
178 + tetCoordinates_[1]*dataDual_[tetVertices_[0]]
179 + tetCoordinates_[2]*dataDual_[tetVertices_[1]]
180 + tetCoordinates_[3]*dataDual_[tetVertices_[2]];
188 const point position,
192 tetGeometry(position, tetIs);
202 this->mesh_.points()[tetVertices_[0]] - this->mesh_.C()[celli],
203 this->mesh_.points()[tetVertices_[1]] - this->mesh_.C()[celli],
204 this->mesh_.points()[tetVertices_[2]] - this->mesh_.C()[celli]
209 const vector t( -
T.T().x() -
T.T().y() -
T.T().z());
213 dataDual_[tetVertices_[0]],
214 dataDual_[tetVertices_[1]],
215 dataDual_[tetVertices_[2]]
218 const Type
s(dataCell_[celli]);
220 return (
T & S) + (t*
s);
#define forAll(list, i)
Loop across all elements in list.
label cell() const
Return the cell.
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.
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 > &)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
TypeGrad interpolateGrad(const point position, const tetIndices &tetIs) const
Interpolate gradient.
outerProduct< vector, Type >::type TypeGrad
Protected typedefs.
Dual(const IOobject &io, const dictionary &dict, const fvMesh &mesh)
Constructors.
label faceBasePt() const
Return the face base point.
void add(const point position, const tetIndices &tetIs, const Type &value)
Member Functions.
virtual ~Dual()
Destructor.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label facePtB() const
Return face point B.
Type interpolate(const point position, const tetIndices &tetIs) const
Interpolate.
Base class for lagrangian averaging methods.
List< label > labelList
A List of labels.
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.
Dual-mesh lagrangian averaging procedure.
scalar mag() const
Return volume.
AveragingMethod< Type >::TypeGrad TypeGrad
Public typedefs.
Mesh data needed to do the Finite Volume discretisation.
scalar barycentric(const point &pt, List< scalar > &bary) const
Calculate the barycentric coordinates of the given.
tmp< GeometricField< Type, fvPatchField, volMesh > > average(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Area-weighted average a surfaceField creating a volField.
void average()
Calculate the average.
tmp< Field< Type > > primitiveField() const
Return an internal field of the average.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
tetPointRef tet(const polyMesh &mesh) const
Return the geometry corresponding to this tet from the.
label size() const
Return the number of elements in the UPtrList.