DUNE PDELab (git)

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.
 
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.
 
typedef C::weight_type weight_type
 The type of the weight applied when accumulating contributions.
 
typedef WeightedMatrixAccumulationView WeightedAccumulationView
 Export this type for uniform handling of the containers themselves and their views.
 
typedef C::size_type size_type
 The size_type of the underlying container.
 

Public Member Functions

WeightedAccumulationView weightedAccumulationView (weight_type weight)
 Returns a WeighedAccumulationView with some weight in addition to this view's weight.
 
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.
 
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.
 
size_type ncols () const
 Returns the number of colums of the underlying container.
 
bool modified () const
 Returns whether this view has been written to.
 
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.
 
const Containercontainer () const
 Returns the container (of type LocalMatrix) that this view is based on (const version).
 
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.
 

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!

Member Function Documentation

◆ 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!

◆ 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.

References Dune::PDELab::WeightedMatrixAccumulationView< C >::weight().

◆ 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.

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


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)