68 out[i] = in[i].second();
70 if (
mag(in[i].first()) > VSMALL)
80 const UList<point>& in,
81 UList<weightedPosition>& out
85 if (in.size() != out.size())
88 <<
"Mismatch in size. Number of points:" << in.size()
89 <<
" != number of weighted positions:" << out.size()
93 const label len = out.size();
95 const label len =
Foam::min(in.size(), out.size());
98 for (label i = 0; i < len; ++i)
100 out[i].second() = out[i].first()*in[i];
108 const weightedPosition&
y 111 x.first() +=
y.first();
112 x.second() +=
y.second();
116 void Foam::weightedPosition::operator()
124 getPoints(
fld, pfld);
128 vt.transformPositionList(pfld);
132 vt.invTransformPositionList(pfld);
135 setPoints(pfld,
fld);
139 void Foam::weightedPosition::operator()
141 const vectorTensorTransform& vt,
143 List<List<weightedPosition>>& flds
146 for (
auto&
fld : flds)
148 operator()(vt, forward,
fld);
153 void Foam::weightedPosition::operator()
155 const coupledPolyPatch& cpp,
156 Field<weightedPosition>&
fld 160 getPoints(
fld, pfld);
162 cpp.transformPosition(pfld);
164 setPoints(pfld,
fld);
177 <<
" does not correspond to the number of points in the mesh " 199 if (
fld.size() != meshPoints.
size())
202 <<
" 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 and vector-space.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
static void getPoints(const UList< weightedPosition > &in, List< point > &out)
Get points.
static void setPoints(const UList< point > &in, UList< weightedPosition > &out)
Set points.
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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))