DUNE PDELab (git)

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>

Public Types

typedef std::vector< T > BaseContainer
 The type of the underlying storage container.
 
typedef BaseContainer::value_type value_type
 The value type of this container.
 
typedef BaseContainer::size_type size_type
 The size type of this container.
 
typedef BaseContainer::reference reference
 The reference type of this container.
 
typedef BaseContainer::const_reference const_reference
 The const reference type of this container.
 
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.
 

Public Member Functions

WeightedAccumulationView weightedAccumulationView (weight_type weight)
 Returns a WeighedAccumulationView of this container with the given weight.
 
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...
 
auto data ()
 Access underlying container.
 
auto data () const
 Access underlying container, const version.
 
LocalVectoraxpy (const value_type alpha, const LocalVector &other)
 Calculate axpy operation this -> this += alpha*other.
 
LocalVectoroperator= (const value_type &v)
 Assigns v to all entries.
 
LocalVectoroperator+= (const LocalVector &other)
 Adds two vectors.
 
LocalVectoroperator*= (const value_type &v)
 Multiplies all entries by v.
 
value_type dot (const LocalVector &other) const
 Dot product with other vector.
 
value_type two_norm () const
 Return Euclidean norm of vector.
 
size_type size () const
 The size of the container.
 
void resize (size_type size)
 Resize the container.
 
void assign (size_type size, const T &value)
 Resize the container to size and assign the passed value to all entries.
 
BaseContainerbase ()
 Returns the underlying, std::vector-like storage container.
 
const BaseContainerbase () const
 Returns the underlying, std::vector-like storage container (const version).
 
 LocalVector ()
 Default constructor.
 
 LocalVector (size_type n)
 Construct a LocalVector with size n.
 
 LocalVector (size_type n, const value_type &v)
 Construct a LocalVector with size n and initialize all entries with v.
 

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

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

Member Function Documentation

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

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 12, 23:30, 2024)