OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
MeshWorker::VectorSelector Class Reference

A class that selects the named FEVector vectors in FEVectors and assigns the types of information extracted. More...

#include <mesh_worker_info.h>

Classes

struct  ListEntry
 The structure which stores the name of the selected FEVector as it is stored in FEVectors and the types of information extracted. More...
 

Public Member Functions

 VectorSelector ()
 Default constructor for an empty object.
 
 VectorSelector (const VectorSelector &other)
 Copy constructor, copying everything except the cache_values, cache_gradients, and cache_hessians.
 
void add_vector (const std::string &name, bool values=true, bool gradients=false, bool hessians=false)
 Add a FEVector name as it is stored in FEVectors to the list of selections.
 
void cache (const FEVectors &src)
 Based on the list of selections, cache the numbers of FEVector vectors in FEVectors appropriately.
 
bool empty () const
 Check whether any FEVector in FEVectors is selected.
 
bool has_values () const
 Returns true if values are selected for any FEVector in FEVectors.
 
bool has_gradients () const
 Returns true if gradients are selected for any FEVector in FEVectors.
 
bool has_hessians () const
 Returns true if hessians are selected for any FEVector in FEVectors.
 
unsigned int n_values () const
 The number of FEVector vectors in FEVectors selected for getting values.
 
unsigned int n_gradients () const
 The number of FEVector vectors in FEVectors selected for getting gradients.
 
unsigned int n_hessians () const
 The number of FEVector vectors in FEVectors selected for getting hessians.
 
unsigned int value_index (unsigned int i) const
 The FEVector index in FEVectors for the ith value.
 
unsigned int gradient_index (unsigned int i) const
 The FEVector index in FEVectors for the ith gradient.
 
unsigned int hessian_index (unsigned int i) const
 The FEVector index in FEVectors for the ith hessian.
 
template<typename STREAM >
void print (STREAM &s, const FEVectors &v) const
 Print the info on the selected FEVector vectors in FEVectors to the stream.
 

Private Attributes

std::vector< ListEntryselection
 The list of selections.
 
bool selected_values
 Set to true if values are selected for any FEVector in FEVectors.
 
bool selected_gradients
 Set to true if gradients are selected for any FEVector in FEVectors.
 
bool selected_hessians
 Set to true if hessians are selected for any FEVector in FEVectors.
 
std::vector< unsigned int > cache_values
 Cache indices of FEVector vectors in FEVectors for which values have been selected.
 
std::vector< unsigned int > cache_gradients
 Cache indices of FEVector vectors in FEVectors for which gradients have been selected.
 
std::vector< unsigned int > cache_hessians
 Cache indices of FEVector vectors in FEVectors for which hessians have been selected.
 

Detailed Description

A class that selects the named FEVector vectors in FEVectors and assigns the types of information extracted.

These types are values, gradients, and hessians.

Author
Guido Kanschat, 2009

Constructor & Destructor Documentation

MeshWorker::VectorSelector::VectorSelector ( )
inline

Default constructor for an empty object.

MeshWorker::VectorSelector::VectorSelector ( const VectorSelector other)
inline

Copy constructor, copying everything except the cache_values, cache_gradients, and cache_hessians.

Member Function Documentation

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

Add a FEVector name as it is stored in FEVectors to the list of selections.

The arguments are the name and indicators showing the types of information extracted for this name.

References MeshWorker::VectorSelector::ListEntry::gradients, MeshWorker::VectorSelector::ListEntry::hessians, MeshWorker::VectorSelector::ListEntry::name, selected_gradients, selected_hessians, selected_values, selection, and MeshWorker::VectorSelector::ListEntry::values.

void MeshWorker::VectorSelector::cache ( const FEVectors src)
inline

Based on the list of selections, cache the numbers of FEVector vectors in FEVectors appropriately.

Available containers are cache_values, cache_gradients, and cache_hessians.

References cache_gradients, cache_hessians, cache_values, AppFrame::FEVectors::find_vector(), and selection.

Referenced by MeshWorker::InfoObjects::IntegrationInfo< dim, FEFaceValuesBase< dim > >::initialize_data(), and MeshWorker::InfoObjects::IntegrationInfo< dim, FEFaceValuesBase< dim > >::initialize_selector().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Check whether any FEVector in FEVectors is selected.

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

The FEVector index in FEVectors for the ith gradient.

Referenced by MeshWorker::selector_index().

Here is the caller graph for this function:

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

Returns true if gradients are selected for any FEVector in FEVectors.

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

Returns true if hessians are selected for any FEVector in FEVectors.

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

Returns true if values are selected for any FEVector in FEVectors.

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

The FEVector index in FEVectors for the ith hessian.

Referenced by MeshWorker::selector_index().

Here is the caller graph for this function:

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

The number of FEVector vectors in FEVectors selected for getting gradients.

Referenced by MeshWorker::selector_size().

Here is the caller graph for this function:

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

The number of FEVector vectors in FEVectors selected for getting hessians.

Referenced by MeshWorker::selector_size().

Here is the caller graph for this function:

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

The number of FEVector vectors in FEVectors selected for getting values.

Referenced by MeshWorker::selector_size().

Here is the caller graph for this function:

template<typename STREAM >
void MeshWorker::VectorSelector::print ( STREAM &  s,
const FEVectors v 
) const
inline

Print the info on the selected FEVector vectors in FEVectors to the stream.

References cache_gradients, cache_hessians, cache_values, and AppFrame::FEVectors::vector_name().

Here is the call graph for this function:

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

The FEVector index in FEVectors for the ith value.

Referenced by MeshWorker::selector_index().

Here is the caller graph for this function:

Member Data Documentation

std::vector<unsigned int> MeshWorker::VectorSelector::cache_gradients
private

Cache indices of FEVector vectors in FEVectors for which gradients have been selected.

Referenced by cache(), and print().

std::vector<unsigned int> MeshWorker::VectorSelector::cache_hessians
private

Cache indices of FEVector vectors in FEVectors for which hessians have been selected.

Referenced by cache(), and print().

std::vector<unsigned int> MeshWorker::VectorSelector::cache_values
private

Cache indices of FEVector vectors in FEVectors for which values have been selected.

Referenced by cache(), and print().

bool MeshWorker::VectorSelector::selected_gradients
private

Set to true if gradients are selected for any FEVector in FEVectors.

Referenced by add_vector().

bool MeshWorker::VectorSelector::selected_hessians
private

Set to true if hessians are selected for any FEVector in FEVectors.

Referenced by add_vector().

bool MeshWorker::VectorSelector::selected_values
private

Set to true if values are selected for any FEVector in FEVectors.

Referenced by add_vector().

std::vector<ListEntry> MeshWorker::VectorSelector::selection
private

The list of selections.

Referenced by add_vector(), and cache().


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