ComponentSelectFunction< dim > Class Template Reference
[Functions]

Inheritance diagram for ComponentSelectFunction< dim >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ComponentSelectFunction (const unsigned int selected, const double value, const unsigned int n_components)
 ComponentSelectFunction (const unsigned int selected, const unsigned int n_components)
 ComponentSelectFunction (const std::pair< unsigned int, unsigned int > &selected, const unsigned int n_components)
virtual void vector_value (const Point< dim > &p, Vector< double > &return_value) const
virtual void vector_value_list (const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const
unsigned int memory_consumption () const

Protected Attributes

const std::pair< unsigned int,
unsigned int
selected_components

Detailed Description

template<int dim>
class ComponentSelectFunction< dim >

This is a constant vector-valued function, in which one or more components of the vector have a constant value and all other components are zero. It is especially useful as a weight function for VectorTools::integrate_difference, where it allows to integrate only one or a few vector components, rather than the entire vector-valued solution. See the step-20 tutorial program for a detailed explanation.

Author:
Guido Kanschat, 2000, Wolfgang Bangerth 2006

Constructor & Destructor Documentation

template<int dim>
ComponentSelectFunction< dim >::ComponentSelectFunction ( const unsigned int  selected,
const double  value,
const unsigned int  n_components 
)

Constructor if only a single component shall be non-zero. Arguments denote the component selected, the value for that component and the total number of vector components.

template<int dim>
ComponentSelectFunction< dim >::ComponentSelectFunction ( const unsigned int  selected,
const unsigned int  n_components 
)

Constructor. As before, but the value for the selected component is assumed to be one. In essence, this function then works as a mask.

template<int dim>
ComponentSelectFunction< dim >::ComponentSelectFunction ( const std::pair< unsigned int, unsigned int > &  selected,
const unsigned int  n_components 
)

Constructor if multiple components shall have non-zero, unit values (i.e. this should be a mask for multiple components). The first argument denotes a half-open interval of components (for example std::pair(0,dim) for the first dim components), and the second argument is the total number of vector components.


Member Function Documentation

template<int dim>
virtual void ComponentSelectFunction< dim >::vector_value ( const Point< dim > &  p,
Vector< double > &  return_value 
) const [virtual]

Return the value of the function at the given point for all components.

Reimplemented from ConstantFunction< dim >.

template<int dim>
virtual void ComponentSelectFunction< dim >::vector_value_list ( const std::vector< Point< dim > > &  points,
std::vector< Vector< double > > &  values 
) const [virtual]

Set values to the point values of the function at the points, for all components. It is assumed that values already has the right size, i.e. the same size as the points array.

Reimplemented from ConstantFunction< dim >.

template<int dim>
unsigned int ComponentSelectFunction< dim >::memory_consumption (  )  const

Determine an estimate for the memory consumption (in bytes) of this object. Since sometimes the size of objects can not be determined exactly (for example: what is the memory consumption of an STL std::map type with a certain number of elements?), this is only an estimate. however often quite close to the true value.

Reimplemented from ConstantFunction< dim >.


Member Data Documentation

template<int dim>
const std::pair<unsigned int,unsigned int> ComponentSelectFunction< dim >::selected_components [protected]

Half-open interval of the indices of selected components.


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

deal.II documentation generated on Mon Nov 23 22:57:33 2009 by doxygen 1.6.1