dune-fem 2.8.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
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 Types

typedef GridPart GridPartType
 
typedef GridPartType::GridType::ctype DomainFieldType
 
typedef FieldVector< DomainFieldType, dimDomainDomainType
 
typedef FieldVector< DomainFieldType, dimGridLocalDomainType
 

Public Member Functions

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

Static Public Attributes

static const int dimDomain = GridPartType::dimensionworld
 
static const int dimGrid = GridPartType::dimension
 

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

Member Typedef Documentation

◆ DomainFieldType

template<class GridPart >
typedef GridPartType::GridType::ctype Dune::Fem::LineSegmentSampler< GridPart >::DomainFieldType

◆ DomainType

template<class GridPart >
typedef FieldVector< DomainFieldType, dimDomain > Dune::Fem::LineSegmentSampler< GridPart >::DomainType

◆ GridPartType

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

◆ LocalDomainType

template<class GridPart >
typedef FieldVector< DomainFieldType, dimGrid > Dune::Fem::LineSegmentSampler< GridPart >::LocalDomainType

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

◆ gridPart()

template<class GridPart >
const GridPart & Dune::Fem::LineSegmentSampler< GridPart >::gridPart ( ) const
inline

obtain grid part on which the LineSegmentSampler works

◆ operator()()

template<class GridPart >
template<class GridFunction >
void Dune::Fem::LineSegmentSampler< GridPart >::operator() ( const GridFunction &  f,
std::vector< typename GridFunction::RangeType > &  samples 
) 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.

◆ 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.

Member Data Documentation

◆ dimDomain

template<class GridPart >
const int Dune::Fem::LineSegmentSampler< GridPart >::dimDomain = GridPartType::dimensionworld
static

◆ dimGrid

template<class GridPart >
const int Dune::Fem::LineSegmentSampler< GridPart >::dimGrid = GridPartType::dimension
static

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