DUNE-FEM (unstable)

Dune::Fem::LineSegmentSampler< GridPart > Class Template Reference

samples values of a discrete function along a given line segment More...

#include <dune/fem/misc/linesegmentsampler.hh>

Public Member Functions

 LineSegmentSampler (const GridPart &gridPart, const DomainType &left, const DomainType &right)
 constructor More...
 
template<class GridFunction >
void operator() (const GridFunction &f, std::vector< typename GridFunction::RangeType > &samples, std::nothrow_t) const
 sample a given function More...
 
void samplePoints (std::vector< DomainType > &points) const
 returns sampling points More...
 
const GridPart & gridPart () const
 obtain grid part on which the LineSegmentSampler works
 

Detailed Description

template<class GridPart>
class Dune::Fem::LineSegmentSampler< GridPart >

samples values of a discrete function along a given line segment

The class LineSegmentSampler provides a method for sampling the values of given discrete function along an arbitrary line contained in some GridPart. The sampling points are always equidistant and include the line segment's end points.

Note
The grid is required to be flat, i.e., grid dimension and world dimension must coincide.
Template Parameters
GridParttype of grid part to sample on

Constructor & Destructor Documentation

◆ LineSegmentSampler()

template<class GridPart >
Dune::Fem::LineSegmentSampler< GridPart >::LineSegmentSampler ( const GridPart &  gridPart,
const DomainType left,
const DomainType right 
)
inline

constructor

Parameters
[in]gridPartthe grid part to sample over
[in]leftleft end point of the line segment
[in]rightright end point of the line segment
Note
Actually, left and right can be exchanged. The order only influences the parametrization of the line segment.
The entire line segment must be a subset of the grid part.

Member Function Documentation

◆ operator()()

template<class GridPart >
template<class GridFunction >
void Dune::Fem::LineSegmentSampler< GridPart >::operator() ( const GridFunction &  f,
std::vector< typename GridFunction::RangeType > &  samples,
std::nothrow_t   
) const
inline

sample a given function

The operator() actually samples the values of a given grid function.

Parameters
[in]fgrid function to sample
[out]samplesstd::vector receiving the samples
Note
The number of sampling points is determined from the size of samples, which may not be less than 2.

References Dune::DenseVector< V >::axpy(), Dune::Geo::ReferenceElements< ctype_, dim >::general(), Dune::Hybrid::max, and Dune::Hybrid::min.

◆ samplePoints()

template<class GridPart >
void Dune::Fem::LineSegmentSampler< GridPart >::samplePoints ( std::vector< DomainType > &  points) const
inline

returns sampling points

The operator() actually samples the values of a given grid function.

Parameters
[out]pointsstd::vector receiving the points
Note
The number of sampling points is determined from the size of points, which may not be less than 2.

References DUNE_THROW.


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)