MeshWorker::VectorSelector Class Reference
[The MeshWorker interface]

Inheritance diagram for MeshWorker::VectorSelector:

Inheritance graph
[legend]

List of all members.

Public Member Functions

void add (const std::string &name, bool values=true, bool gradients=false, bool hessians=false)
template<class DATA>
void initialize (const NamedData< DATA > &)
bool empty () const
bool has_values () const
bool has_gradients () const
bool has_hessians () const
unsigned int n_values () const
unsigned int n_gradients () const
unsigned int n_hessians () const
unsigned int value_index (unsigned int i) const
unsigned int gradient_index (unsigned int i) const
unsigned int hessian_index (unsigned int i) const
template<class STREAM, typename DATA>
void print (STREAM &s, const NamedData< DATA > &v) const
template<class STREAM>
void print (STREAM &s) const

Protected Attributes

NamedSelection value_selection
NamedSelection gradient_selection
NamedSelection hessian_selection


Detailed Description

A class that selects vectors from a list of named vectors.

Since the number of vectors in a NamedData object may grow with every nesting of applications or loops, it is important to be able to select those, which are actually used in computing residuals etc. This class organizes the selection.

It is used for instance in IntegrationWorker to determine which values, derivatives or second derivatives are actually computed.

Author:
Guido Kanschat 2009

Member Function Documentation

void MeshWorker::VectorSelector::add ( const std::string &  name,
bool  values = true,
bool  gradients = false,
bool  hessians = false 
) [inline]

Add a vector to the selection of finite element functions. The arguments are the name of the vector and indicators, which information is to be extracted from the vector. The name refers to an entry in a NamedData object, which will be identified by initialize(). The three bool parameters indicate, whether values, greadients and Hessians of the finite element function are to be computed on each cell or face.

References NamedSelection::add(), gradient_selection, hessian_selection, and value_selection.

template<typename DATA>
void MeshWorker::VectorSelector::initialize ( const NamedData< DATA > &  src  )  [inline]

Does the same as the function above but it is possible to select a block of the global vector. Initialize the selection field with a data vector. While add() only enters the names of vectors, which will be used in the integration loop over cells and faces, this function links the names to actual vectos in a NamedData object.

Note:
This function caches the index associated with a name. Therefore, it must be called everytime after the NamedData object has changed.

References gradient_selection, hessian_selection, NamedSelection::initialize(), and value_selection.

bool MeshWorker::VectorSelector::empty (  )  const [inline]

Check whether any vector is selected.

References gradient_selection, hessian_selection, NamedSelection::size(), and value_selection.

bool MeshWorker::VectorSelector::has_values (  )  const [inline]

Returns true if values are selected for any vector.

References NamedSelection::size(), and value_selection.

bool MeshWorker::VectorSelector::has_gradients (  )  const [inline]

Returns true if gradients are selected for any vector.

References gradient_selection, and NamedSelection::size().

bool MeshWorker::VectorSelector::has_hessians (  )  const [inline]

Returns true if hessians are selected for any vector.

References hessian_selection, and NamedSelection::size().

unsigned int MeshWorker::VectorSelector::n_values (  )  const [inline]

Number of vectors for values

References NamedSelection::size(), and value_selection.

Referenced by print().

unsigned int MeshWorker::VectorSelector::n_gradients (  )  const [inline]

Number of vectors for gradients

References gradient_selection, and NamedSelection::size().

Referenced by print().

unsigned int MeshWorker::VectorSelector::n_hessians (  )  const [inline]

Number of vectors for Hessians

References hessian_selection, and NamedSelection::size().

Referenced by print().

unsigned int MeshWorker::VectorSelector::value_index ( unsigned int  i  )  const [inline]

The vector index for the ith value

References value_selection.

unsigned int MeshWorker::VectorSelector::gradient_index ( unsigned int  i  )  const [inline]

The vector index for the ith gradient

References gradient_selection.

unsigned int MeshWorker::VectorSelector::hessian_index ( unsigned int  i  )  const [inline]

The vector index for the ith Hessian

References hessian_selection.

template<class STREAM, typename DATA>
void MeshWorker::VectorSelector::print ( STREAM &  s,
const NamedData< DATA > &  v 
) const [inline]

Print the contents of the selection to the stream.

References gradient_selection, hessian_selection, n_gradients(), n_hessians(), n_values(), NamedData< DATA >::name(), and value_selection.

template<class STREAM>
void MeshWorker::VectorSelector::print ( STREAM &  s  )  const [inline]

Print the number of selections to the stream.

References n_gradients(), n_hessians(), and n_values().


Member Data Documentation

Selection of the vectors used to compute values.

Referenced by add(), empty(), has_values(), initialize(), n_values(), print(), and value_index().

Selection of the vectors used to compute gradients.

Referenced by add(), empty(), gradient_index(), has_gradients(), initialize(), n_gradients(), and print().

Selection of the vectors used to compute hessians.

Referenced by add(), empty(), has_hessians(), hessian_index(), initialize(), n_hessians(), and print().


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

deal.II documentation generated on Wed Sep 8 23:06:47 2010 by doxygen 1.5.6