Public Member Functions | Protected Attributes

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
std::size_t memory_consumption () 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

Definition at line 42 of file vector_selector.h.


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.

Definition at line 477 of file vector_selector.h.

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.

Definition at line 498 of file vector_selector.h.

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

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

Check whether any vector is selected.

Definition at line 506 of file vector_selector.h.

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.

Definition at line 515 of file vector_selector.h.

References NamedSelection::size(), and value_selection.

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

Returns true if gradients are selected for any vector.

Definition at line 522 of file vector_selector.h.

References gradient_selection, and NamedSelection::size().

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

Returns true if hessians are selected for any vector.

Definition at line 529 of file vector_selector.h.

References hessian_selection, and NamedSelection::size().

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

Number of vectors for values

Definition at line 536 of file vector_selector.h.

References NamedSelection::size(), and value_selection.

Referenced by print().

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

Number of vectors for gradients

Definition at line 543 of file vector_selector.h.

References gradient_selection, and NamedSelection::size().

Referenced by print().

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

Number of vectors for Hessians

Definition at line 550 of file vector_selector.h.

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

Definition at line 557 of file vector_selector.h.

References value_selection.

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

The vector index for the ith gradient

Definition at line 564 of file vector_selector.h.

References gradient_selection.

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

The vector index for the ith Hessian

Definition at line 571 of file vector_selector.h.

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.

Definition at line 590 of file vector_selector.h.

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.

Definition at line 579 of file vector_selector.h.

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

std::size_t MeshWorker::VectorSelector::memory_consumption (  ) const [inline]

Member Data Documentation

Selection of the vectors used to compute values.

Definition at line 178 of file vector_selector.h.

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

Selection of the vectors used to compute gradients.

Definition at line 184 of file vector_selector.h.

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

Selection of the vectors used to compute hessians.

Definition at line 190 of file vector_selector.h.

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


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:15 by doxygen 1.7.2