dune-pdelab  2.5-dev
Public Types | Public Member Functions | List of all members
Dune::PDELab::LocalVector< T, LFSFlavorTag, W > Class Template Reference

A container for storing data associated with the degrees of freedom of a LocalFunctionSpace. More...

#include <dune/pdelab/gridfunctionspace/localvector.hh>

Inheritance diagram for Dune::PDELab::LocalVector< T, LFSFlavorTag, W >:
Inheritance graph

Public Types

typedef std::vector< T > BaseContainer
 The type of the underlying storage container. More...
 
typedef BaseContainer::value_type value_type
 The value type of this container. More...
 
typedef BaseContainer::size_type size_type
 The size type of this container. More...
 
typedef BaseContainer::reference reference
 The reference type of this container. More...
 
typedef BaseContainer::const_reference const_reference
 The const reference type of this container. More...
 
typedef W weight_type
 The weight type of this container. More...
 
typedef WeightedVectorAccumulationView< LocalVectorWeightedAccumulationView
 An accumulate-only view of this container that automatically applies a weight to all contributions. More...
 

Public Member Functions

WeightedAccumulationView weightedAccumulationView (weight_type weight)
 Returns a WeighedAccumulationView of this container with the given weight. More...
 
template<typename LFS >
reference operator() (const LFS &lfs, size_type i)
 Access the value in this container associated with the i-th degree of freedom of the LocalFunctionSpace lfs. More...
 
template<typename LFS >
const_reference operator() (const LFS &lfs, size_type i) const
 Access the value in this container associated with the i-th degree of freedom of the LocalFunctionSpace lfs (const version). More...
 
LocalVectoroperator= (const value_type &v)
 Assigns v to all entries. More...
 
LocalVectoroperator*= (const value_type &v)
 Multiplies all entries by v. More...
 
size_type size () const
 The size of the container. More...
 
void resize (size_type size)
 Resize the container. More...
 
void assign (size_type size, const T &value)
 Resize the container to size and assign the passed value to all entries. More...
 
BaseContainerbase ()
 Returns the underlying, std::vector-like storage container. More...
 
const BaseContainerbase () const
 Returns the underlying, std::vector-like storage container (const version). More...
 
 LocalVector ()
 Default constructor. More...
 
 LocalVector (size_type n)
 Construct a LocalVector with size n. More...
 
 LocalVector (size_type n, const value_type &v)
 Construct a LocalVector with size n and initialize all entries with v. More...
 

Detailed Description

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
class Dune::PDELab::LocalVector< T, LFSFlavorTag, W >

A container for storing data associated with the degrees of freedom of a LocalFunctionSpace.

This container acts as a wrapper around a std::vector-like container and supports accessing its entries indexed by pairs of (LocalFunctionSpace,DOF of LocalFunctionSpace). If requested by specifying a non-default LFSFlavorTag, the container will also assert that a LocalFunctionSpace of the matching kind (trial or test space) is used to access its content.

Template Parameters
TThe type of values to store in the vector.
LFSFlavorTagTag type for differentiating between trial and test space vectors.
WThe type of weight applied in a WeightedAccumulationView.

Member Typedef Documentation

§ BaseContainer

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
typedef std::vector<T> Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::BaseContainer

The type of the underlying storage container.

§ const_reference

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
typedef BaseContainer::const_reference Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::const_reference

The const reference type of this container.

§ reference

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
typedef BaseContainer::reference Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::reference

The reference type of this container.

§ size_type

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
typedef BaseContainer::size_type Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::size_type

The size type of this container.

§ value_type

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
typedef BaseContainer::value_type Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::value_type

The value type of this container.

§ weight_type

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
typedef W Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::weight_type

The weight type of this container.

A value of this type will be used to assign a weight to contributions in a WeightedAccumulationView.

§ WeightedAccumulationView

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
typedef WeightedVectorAccumulationView<LocalVector> Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::WeightedAccumulationView

An accumulate-only view of this container that automatically applies a weight to all contributions.

Constructor & Destructor Documentation

§ LocalVector() [1/3]

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::LocalVector ( )
inline

Default constructor.

§ LocalVector() [2/3]

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::LocalVector ( size_type  n)
inlineexplicit

Construct a LocalVector with size n.

§ LocalVector() [3/3]

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::LocalVector ( size_type  n,
const value_type v 
)
inline

Construct a LocalVector with size n and initialize all entries with v.

Member Function Documentation

§ assign()

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
void Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::assign ( size_type  size,
const T &  value 
)
inline

Resize the container to size and assign the passed value to all entries.

§ base() [1/2]

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
BaseContainer& Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::base ( )
inline

Returns the underlying, std::vector-like storage container.

§ base() [2/2]

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
const BaseContainer& Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::base ( ) const
inline

Returns the underlying, std::vector-like storage container (const version).

§ operator()() [1/2]

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
template<typename LFS >
reference Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::operator() ( const LFS &  lfs,
size_type  i 
)
inline

Access the value in this container associated with the i-th degree of freedom of the LocalFunctionSpace lfs.

Parameters
lfsThe LocalFunctionSpace for which to retrieve a value. This must be the LFS that has been used to load the values into this vector or one of its children (right now, this is not checked).
iThe index of the degree of freedom of the LocalFunctionSpace that will be returned.

§ operator()() [2/2]

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
template<typename LFS >
const_reference Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::operator() ( const LFS &  lfs,
size_type  i 
) const
inline

Access the value in this container associated with the i-th degree of freedom of the LocalFunctionSpace lfs (const version).

Parameters
lfsThe LocalFunctionSpace for which to retrieve a value. This must be the LFS that has been used to load the values into this vector or one of its children (right now, this is not checked).
iThe index of the degree of freedom of the LocalFunctionSpace that will be returned.

§ operator*=()

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
LocalVector& Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::operator*= ( const value_type v)
inline

Multiplies all entries by v.

§ operator=()

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
LocalVector& Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::operator= ( const value_type v)
inline

Assigns v to all entries.

§ resize()

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
void Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::resize ( size_type  size)
inline

Resize the container.

§ size()

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
size_type Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::size ( ) const
inline

The size of the container.

§ weightedAccumulationView()

template<typename T, typename LFSFlavorTag = AnySpaceTag, typename W = T>
WeightedAccumulationView Dune::PDELab::LocalVector< T, LFSFlavorTag, W >::weightedAccumulationView ( weight_type  weight)
inline

Returns a WeighedAccumulationView of this container with the given weight.


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