FilterField Class Reference

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
 

Detailed Description

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.

Note
When handling large search radii and/or an extensive number of filter sweeps, compiling with openmp can yield some speedup.
Source files

Definition at line 70 of file MappedFileFilterField.H.

Member Enumeration Documentation

◆ RBF_type

enum RBF_type

Basis type.

Enumerator
RBF_linear 
RBF_quadratic 

Definition at line 79 of file MappedFileFilterField.H.

Constructor & Destructor Documentation

◆ FilterField() [1/3]

FilterField ( )
defaultnoexcept

Default construct.

◆ FilterField() [2/3]

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() [3/3]

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().

Here is the call graph for this function:

Member Function Documentation

◆ ClassName()

ClassName ( "filterField"  )

Runtime type information.

◆ reset() [1/3]

void reset ( )

Reset to unweighted (pass-through)

Definition at line 263 of file MappedFileFilterField.C.

◆ reset() [2/3]

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().

Here is the call graph for this function:

◆ reset() [3/3]

void reset ( const meshedSurface geom,
const scalar  radius,
const bool  relative = false,
const RBF_type  interp = RBF_type::RBF_linear 
)

◆ evaluate() [1/2]

tmp<Field<Type> > evaluate ( const tmp< Field< Type >> &  tinput,
const label  nSweeps 
) const

Return the median smoothed field.

◆ evaluate() [2/2]

Foam::tmp<Foam::Field<Type> > evaluate ( const tmp< Field< Type >> &  tinput,
const label  nSweeps 
) const

The documentation for this class was generated from the following files: