dune-pdelab  2.4-dev
Public Types | Public Member Functions | List of all members
Dune::PDELab::WeightedVectorAccumulationView< C > Class Template Reference

An accumulate-only view on a local vector that automatically takes into account an accumulation weight. More...

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

Public Types

typedef C Container
 The type of the underlying LocalVector. More...
 
typedef Container::BaseContainer BaseContainer
 The type of the storage container underlying the LocalVector. More...
 
typedef Container::value_type value_type
 The value type of the entries. More...
 
typedef Container::weight_type weight_type
 The type of the weight applied when accumulating contributions. More...
 
typedef WeightedVectorAccumulationView WeightedAccumulationView
 Export this type for uniform handling of the containers themselves and their views. More...
 
typedef Container::size_type size_type
 The size_type of the underlying container. More...
 

Public Member Functions

WeightedAccumulationView weightedAccumulationView (weight_type weight)
 Returns a WeighedAccumulationView with some weight in addition to this view's weight. More...
 
weight_type weight ()
 Returns the weight associated with this view. More...
 
void setWeight (weight_type weight)
 Resets the weighting coefficient of the view. More...
 
template<typename LFS >
void accumulate (const LFS &lfs, size_type n, value_type v)
 Applies the current weight to v and adds the result to the n-th degree of freedom of the lfs. More...
 
template<typename LFS >
void rawAccumulate (const LFS &lfs, size_type n, value_type v)
 Adds v to the n-th degree of freedom of the lfs without applying the current weight. More...
 
 WeightedVectorAccumulationView (C &container, weight_type weight)
 Constructor. More...
 
size_type size () const
 Returns the size of the underlying container. More...
 
bool modified () const
 Returns whether this view has been written to. More...
 
void resetModified ()
 Resets the modification state of the view to not modified. More...
 
Containercontainer ()
 Returns the container (of type LocalVector) that this view is based on. More...
 
const Containercontainer () const
 Returns the container (of type LocalVector) that this view is based on (const version). More...
 
BaseContainerbase ()
 Returns the storage container of the underlying LocalVector. More...
 
const BaseContainerbase () const
 Returns the storage container of the underlying LocalVector (const version). More...
 

Detailed Description

template<typename C>
class Dune::PDELab::WeightedVectorAccumulationView< C >

An accumulate-only view on a local vector that automatically takes into account an accumulation weight.

Member Typedef Documentation

template<typename C>
typedef Container::BaseContainer Dune::PDELab::WeightedVectorAccumulationView< C >::BaseContainer

The type of the storage container underlying the LocalVector.

template<typename C>
typedef C Dune::PDELab::WeightedVectorAccumulationView< C >::Container

The type of the underlying LocalVector.

template<typename C>
typedef Container::size_type Dune::PDELab::WeightedVectorAccumulationView< C >::size_type

The size_type of the underlying container.

template<typename C>
typedef Container::value_type Dune::PDELab::WeightedVectorAccumulationView< C >::value_type

The value type of the entries.

template<typename C>
typedef Container::weight_type Dune::PDELab::WeightedVectorAccumulationView< C >::weight_type

The type of the weight applied when accumulating contributions.

Export this type for uniform handling of the containers themselves and their views.

Constructor & Destructor Documentation

template<typename C>
Dune::PDELab::WeightedVectorAccumulationView< C >::WeightedVectorAccumulationView ( C &  container,
weight_type  weight 
)
inline

Constructor.

Member Function Documentation

template<typename C>
template<typename LFS >
void Dune::PDELab::WeightedVectorAccumulationView< C >::accumulate ( const LFS &  lfs,
size_type  n,
value_type  v 
)
inline

Applies the current weight to v and adds the result to the n-th degree of freedom of the lfs.

template<typename C>
BaseContainer& Dune::PDELab::WeightedVectorAccumulationView< C >::base ( )
inline

Returns the storage container of the underlying LocalVector.

Referenced by Dune::PDELab::accessBaseContainer().

template<typename C>
const BaseContainer& Dune::PDELab::WeightedVectorAccumulationView< C >::base ( ) const
inline

Returns the storage container of the underlying LocalVector (const version).

template<typename C>
Container& Dune::PDELab::WeightedVectorAccumulationView< C >::container ( )
inline

Returns the container (of type LocalVector) that this view is based on.

Referenced by Dune::PDELab::WeightedVectorAccumulationView< C >::weightedAccumulationView().

template<typename C>
const Container& Dune::PDELab::WeightedVectorAccumulationView< C >::container ( ) const
inline

Returns the container (of type LocalVector) that this view is based on (const version).

template<typename C>
bool Dune::PDELab::WeightedVectorAccumulationView< C >::modified ( ) const
inline

Returns whether this view has been written to.

template<typename C>
template<typename LFS >
void Dune::PDELab::WeightedVectorAccumulationView< C >::rawAccumulate ( const LFS &  lfs,
size_type  n,
value_type  v 
)
inline

Adds v to the n-th degree of freedom of the lfs without applying the current weight.

Warning
When using this method, you must take care of applying the weight yourself, otherwise your program may exhibit strange behavior or even calculate wrong results!
template<typename C>
void Dune::PDELab::WeightedVectorAccumulationView< C >::resetModified ( )
inline

Resets the modification state of the view to not modified.

Warning
Never call this method from within a local operator, or your local residual / matrix contributions will be lost!
template<typename C>
void Dune::PDELab::WeightedVectorAccumulationView< C >::setWeight ( weight_type  weight)
inline
template<typename C>
size_type Dune::PDELab::WeightedVectorAccumulationView< C >::size ( ) const
inline

Returns the size of the underlying container.

template<typename C>
weight_type Dune::PDELab::WeightedVectorAccumulationView< C >::weight ( )
inline

Returns the weight associated with this view.

Note
This can be used together with rawAccumulate() to avoid applying the weight at each loop iteration.

Referenced by Dune::PDELab::WeightedVectorAccumulationView< C >::setWeight(), and Dune::PDELab::WeightedVectorAccumulationView< C >::weightedAccumulationView().

template<typename C>
WeightedAccumulationView Dune::PDELab::WeightedVectorAccumulationView< C >::weightedAccumulationView ( weight_type  weight)
inline

Returns a WeighedAccumulationView with some weight in addition to this view's weight.

References Dune::PDELab::WeightedVectorAccumulationView< C >::container(), and Dune::PDELab::WeightedVectorAccumulationView< C >::weight().


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