The FilterField helper class provides a multi-sweep median filter for a Field of data associated with a geometric point cloud. More...
Public Types | |
enum | RBF_type { RBF_linear, RBF_quadratic } |
Basis type. More... | |
Public Member Functions | |
ClassName ("filterField") | |
Runtime type information. More... | |
FilterField () noexcept=default | |
Default construct. More... | |
FilterField (const pointField &points, const scalar radius, const RBF_type interp=RBF_type::RBF_linear) | |
Construct with weights for a field of points (constant search radius) More... | |
FilterField (const meshedSurface &geom, const scalar radius, const bool relative=false, const RBF_type interp=RBF_type::RBF_linear) | |
Construct with weights for faceCentres of a meshedSurface using a constant search radius search (or relative radius multiplier for the face bounding spheres). More... | |
void | reset () |
Reset to unweighted (pass-through) More... | |
void | reset (const pointField &points, const scalar radius, const RBF_type interp=RBF_type::RBF_linear) |
Create weights for field of points (constant search radius) More... | |
void | reset (const meshedSurface &geom, const scalar radius, const bool relative=false, const RBF_type interp=RBF_type::RBF_linear) |
Create weights for meshedSurface using a constant search radius or optionally with a search radius multiplier for the face bounding spheres. More... | |
template<class Type > | |
tmp< Field< Type > > | evaluate (const tmp< Field< Type >> &tinput, const label nSweeps) const |
Return the median smoothed field. More... | |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | evaluate (const tmp< Field< Type >> &tinput, const label nSweeps) const |
The FilterField helper class provides a multi-sweep median filter for a Field of data associated with a geometric point cloud.
The points can be freestanding or the faceCentres (or points) of a meshedSurface, for example.
Using an initial specified search radius, the nearest point neighbours are gathered and addressing/weights are built for them. This currently uses an area-weighted, linear RBF interpolator with provision for quadratic RBF interpolator etc.
After the weights and addressing are established, the evaluate() method can be called to apply a median filter to data fields, with a specified number of sweeps.
Definition at line 70 of file MappedFileFilterField.H.
enum RBF_type |
Basis type.
Enumerator | |
---|---|
RBF_linear | |
RBF_quadratic |
Definition at line 79 of file MappedFileFilterField.H.
|
defaultnoexcept |
Default construct.
FilterField | ( | const pointField & | points, |
const scalar | radius, | ||
const RBF_type | interp = RBF_type::RBF_linear |
||
) |
Construct with weights for a field of points (constant search radius)
Definition at line 239 of file MappedFileFilterField.C.
References points.
FilterField | ( | const meshedSurface & | geom, |
const scalar | radius, | ||
const bool | relative = false , |
||
const RBF_type | interp = RBF_type::RBF_linear |
||
) |
Construct with weights for faceCentres of a meshedSurface using a constant search radius search (or relative radius multiplier for the face bounding spheres).
Definition at line 250 of file MappedFileFilterField.C.
References Foam::fvc::relative().
ClassName | ( | "filterField" | ) |
Runtime type information.
void reset | ( | ) |
Reset to unweighted (pass-through)
Definition at line 263 of file MappedFileFilterField.C.
void reset | ( | const pointField & | points, |
const scalar | radius, | ||
const RBF_type | interp = RBF_type::RBF_linear |
||
) |
Create weights for field of points (constant search radius)
Definition at line 271 of file MappedFileFilterField.C.
References Foam::createTree(), Foam::ensightOutput::debug, Foam::endl(), Foam::linearWeight(), Foam::nl, points, Foam::Pout, Foam::quadraticWeight(), and Foam::sqr().
void reset | ( | const meshedSurface & | geom, |
const scalar | radius, | ||
const bool | relative = false , |
||
const RBF_type | interp = RBF_type::RBF_linear |
||
) |
Create weights for meshedSurface using a constant search radius or optionally with a search radius multiplier for the face bounding spheres.
Definition at line 311 of file MappedFileFilterField.C.
References Foam::createTree(), Foam::ensightOutput::debug, Foam::endl(), PrimitivePatch< FaceList, PointField >::faceCentres(), Foam::linearWeight(), MeshedSurface< Face >::magSf(), PrimitivePatch< FaceList, PointField >::nFaces(), Foam::nl, PrimitivePatch< FaceList, PointField >::points(), Foam::Pout, Foam::quadraticWeight(), Foam::fvc::relative(), PrimitivePatch< FaceList, PointField >::sphere(), and Foam::sqr().
Return the median smoothed field.
Foam::tmp<Foam::Field<Type> > evaluate | ( | const tmp< Field< Type >> & | tinput, |
const label | nSweeps | ||
) | const |
Definition at line 29 of file MappedFileFilterFieldTemplates.C.
References tmp< T >::cref(), Foam::endl(), forAll, Foam::input(), Foam::New(), nPoints, Foam::output(), tmp< T >::reset(), tmp< T >::swap(), Foam::fvc::sweep(), WarningInFunction, and Foam::Zero.