41 if (nSweeps < 1 || !tinput.good())
47 label
nPoints = tinput().size();
49 const label nAddr = addressing_.
size();
63 <<
"Addressing/weights shorter than input field" 70 toutput.ref().slice(nAddr) = tinput().slice(nAddr);
84 tbuffer.
reset(tinput.ptr());
97 tbuffer.
swap(toutput);
100 const auto&
input = tbuffer();
101 auto&
output = toutput.ref();
103 #pragma omp parallel for if (nPoints > 1000) 104 for (label pointi = 0; pointi <
nPoints; ++pointi)
106 const auto& addr = addressing_[pointi];
107 const auto& weight = weights_[pointi];
109 auto& interp =
output[pointi];
114 interp =
input[pointi];
122 interp += (weight[i] *
input[addr[i]]);
void size(const label n)
Older name for setAddressableSize.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
#define forAll(list, i)
Loop across all elements in list.
void sweep(volScalarField &field, const volScalarField &alpha, const label nLayers, const scalar alphaDiff=0.2)
Generic templated field type.
static Istream & input(Istream &is, IntRange< T > &range)
void swap(tmp< T > &other) noexcept
Swaps the managed object with other.
tmp< Field< Type > > evaluate(const tmp< Field< Type >> &tinput, const label nSweeps) const
Return the median smoothed field.
#define WarningInFunction
Report a warning using Foam::Warning.
static Ostream & output(Ostream &os, const IntRange< T > &range)
A class for managing temporary objects.
void reset(tmp< T > &&other) noexcept
Clear existing and transfer ownership.
static constexpr const zero Zero
Global zero (0)