dune-pdelab  2.7-git
Public Types | Public Member Functions | List of all members
Dune::PDELab::WeightedMatrixAccumulationView< C > Class Template Reference

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

#include <dune/pdelab/gridoperator/common/localmatrix.hh>

Public Types

typedef C Container
 The type of the underlying container. More...
 
typedef Container::BaseContainer BaseContainer
 The type of the storage container underlying the LocalVector. More...
 
typedef C::value_type value_type
 The value type of the entries. More...
 
typedef C::weight_type weight_type
 The type of the weight applied when accumulating contributions. More...
 
typedef WeightedMatrixAccumulationView WeightedAccumulationView
 Export this type for uniform handling of the containers themselves and their views. More...
 
typedef C::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 () const
 Returns the weight associated with this view. More...
 
void setWeight (weight_type weight)
 Resets the weighting coefficient of the view. More...
 
template<typename LFSU , typename LFSV >
void accumulate (const LFSV &lfsv, size_type i, const LFSU &lfsu, size_type j, value_type v)
 Applies the current weight to v and adds the result to the matrix entry associated with the i-th entry of lfsv and the j-th entry of lfsu. More...
 
template<typename LFSU , typename LFSV >
void rawAccumulate (const LFSV &lfsv, size_type i, const LFSU &lfsu, size_type j, value_type v)
 Adds v to the (i,j)-th entry of the underlying container without applying the current weight. More...
 
size_type nrows () const
 Returns the number of rows of the underlying container. More...
 
size_type ncols () const
 Returns the number of colums 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 LocalMatrix) that this view is based on. More...
 
const Containercontainer () const
 Returns the container (of type LocalMatrix) that this view is based on (const version). More...
 
BaseContainerbase ()
 Returns the storage container of the underlying LocalMatrix. More...
 
const BaseContainerbase () const
 Returns the storage container of the underlying LocalVector (const version). More...
 
 WeightedMatrixAccumulationView (Container &container, weight_type weight)
 Constructor. More...
 

Detailed Description

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

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

Member Typedef Documentation

◆ BaseContainer

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

The type of the storage container underlying the LocalVector.

Warning
This is not a matrix-like container anymore, but a std::vector-like one!

◆ Container

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

The type of the underlying container.

◆ size_type

template<typename C >
typedef C::size_type Dune::PDELab::WeightedMatrixAccumulationView< C >::size_type

The size_type of the underlying container.

◆ value_type

template<typename C >
typedef C::value_type Dune::PDELab::WeightedMatrixAccumulationView< C >::value_type

The value type of the entries.

◆ weight_type

template<typename C >
typedef C::weight_type Dune::PDELab::WeightedMatrixAccumulationView< C >::weight_type

The type of the weight applied when accumulating contributions.

◆ WeightedAccumulationView

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

Constructor & Destructor Documentation

◆ WeightedMatrixAccumulationView()

template<typename C >
Dune::PDELab::WeightedMatrixAccumulationView< C >::WeightedMatrixAccumulationView ( Container container,
weight_type  weight 
)
inline

Constructor.

Member Function Documentation

◆ accumulate()

template<typename C >
template<typename LFSU , typename LFSV >
void Dune::PDELab::WeightedMatrixAccumulationView< C >::accumulate ( const LFSV &  lfsv,
size_type  i,
const LFSU &  lfsu,
size_type  j,
value_type  v 
)
inline

Applies the current weight to v and adds the result to the matrix entry associated with the i-th entry of lfsv and the j-th entry of lfsu.

◆ base() [1/2]

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

Returns the storage container of the underlying LocalMatrix.

Warning
This is not a matrix-like container anymore, but a std::vector-like one!

◆ base() [2/2]

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

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

Warning
This is not a matrix-like container anymore, but a std::vector-like one!

◆ container() [1/2]

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

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

◆ container() [2/2]

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

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

◆ modified()

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

Returns whether this view has been written to.

◆ ncols()

template<typename C >
size_type Dune::PDELab::WeightedMatrixAccumulationView< C >::ncols ( ) const
inline

Returns the number of colums of the underlying container.

◆ nrows()

template<typename C >
size_type Dune::PDELab::WeightedMatrixAccumulationView< C >::nrows ( ) const
inline

Returns the number of rows of the underlying container.

◆ rawAccumulate()

template<typename C >
template<typename LFSU , typename LFSV >
void Dune::PDELab::WeightedMatrixAccumulationView< C >::rawAccumulate ( const LFSV &  lfsv,
size_type  i,
const LFSU &  lfsu,
size_type  j,
value_type  v 
)
inline

Adds v to the (i,j)-th entry of the underlying container 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!

◆ resetModified()

template<typename C >
void Dune::PDELab::WeightedMatrixAccumulationView< 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!

◆ setWeight()

template<typename C >
void Dune::PDELab::WeightedMatrixAccumulationView< C >::setWeight ( weight_type  weight)
inline

Resets the weighting coefficient of the view.

Warning
Only call this method when you know what you are doing! It is especially not meant to be called from inside local operators.

◆ weight()

template<typename C >
weight_type Dune::PDELab::WeightedMatrixAccumulationView< C >::weight ( ) const
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.

◆ weightedAccumulationView()

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

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


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