68 out[i] = in[i].second();
70 if (
mag(in[i].first()) > VSMALL)
80 const UList<point>& in,
81 List<weightedPosition>& out
84 out.setSize(in.size());
87 out[i].second() = out[i].first()*in[i];
95 const weightedPosition&
y 98 x.first() +=
y.first();
99 x.second() +=
y.second();
103 void Foam::weightedPosition::operator()
111 getPoints(
fld, pfld);
115 pfld = vt.transformPosition(pfld);
119 pfld = vt.invTransformPosition(pfld);
122 setPoints(pfld,
fld);
126 void Foam::weightedPosition::operator()
128 const vectorTensorTransform& vt,
130 List<List<weightedPosition>>& flds
133 for (List<weightedPosition>&
fld : flds)
135 operator()(vt, forward,
fld);
140 void Foam::weightedPosition::operator()
142 const coupledPolyPatch& cpp,
143 Field<weightedPosition>&
fld 147 getPoints(
fld, pfld);
149 cpp.transformPosition(pfld);
151 setPoints(pfld,
fld);
164 <<
" does not correspond to the number of points in the mesh " 186 if (
fld.size() != meshPoints.
size())
189 <<
" does not correspond to the number of points supplied " weightedPosition()
Construct null.
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static void plusEqOp(weightedPosition &x, const weightedPosition &y)
Summation operator.
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
static const weightedPosition zero
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T & first()
Access first element of the list, position [0].
A traits class, which is primarily used for primitives.
static void getPoints(const UList< weightedPosition > &in, List< point > &out)
Get points.
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
void setSize(const label n)
Alias for resize()
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static void setPoints(const UList< point > &in, List< weightedPosition > &out)
Set points.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Wrapper for position + weight to be used in e.g. averaging.
Mesh consisting of general polyhedral cells.
static void syncPoints(const polyMesh &mesh, List< weightedPosition > &)
Synchronisation for mesh point positions.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))