SOFA API  fdacdac3
Open source framework for multi-physics simuation
sofa::core::AccumulationVecId< TDataTypes, vtype, vaccess > Struct Template Reference

#include <AccumulationVecId.h>

Proxy class for accessing elements within an imaginary container that represents the cumulative sum of multiple other containers. Each individual container is represented by a VecId. The class maintains a list of VecIdDeriv objects, which defines the containers contributing to the final cumulative sum. This class provides a simplified interface for accessing elements within the cumulative container. It allows retrieving specific elements using the overloaded subscript operator (operator[]). When accessing an element at a particular index, the class delegates the retrieval to the appropriate container represented by the associated VecIdDeriv. In addition to element retrieval, the class supports dynamic management of the contributing containers. It offers functions to add and remove VecId objects from the list of containers that contribute to the cumulative sum. More...

Inheritance diagram for sofa::core::AccumulationVecId< TDataTypes, vtype, vaccess >:

Detailed Description

template<class TDataTypes, VecType vtype, VecAccess vaccess>
struct sofa::core::AccumulationVecId< TDataTypes, vtype, vaccess >

Proxy class for accessing elements within an imaginary container that represents the cumulative sum of multiple other containers. Each individual container is represented by a VecId. The class maintains a list of VecIdDeriv objects, which defines the containers contributing to the final cumulative sum. This class provides a simplified interface for accessing elements within the cumulative container. It allows retrieving specific elements using the overloaded subscript operator (operator[]). When accessing an element at a particular index, the class delegates the retrieval to the appropriate container represented by the associated VecIdDeriv. In addition to element retrieval, the class supports dynamic management of the contributing containers. It offers functions to add and remove VecId objects from the list of containers that contribute to the cumulative sum.

Template Parameters
TDataTypesType of DOFs stored in the State

Public Member Functions

Deriv operator[] (Size i) const
 
void addToContributingVecIds (core::ConstVecDerivId vecDerivId)
 The provided VecDerivId container will contribute in the cumulative sum. More...
 
void removeFromContributingVecIds (core::ConstVecDerivId vecDerivId)
 
 AccumulationVecId (const State< TDataTypes > &state)
 
 AccumulationVecId ()=delete
 

Constructor details

◆ AccumulationVecId() [1/2]

template<class TDataTypes , VecType vtype, VecAccess vaccess>
sofa::core::AccumulationVecId< TDataTypes, vtype, vaccess >::AccumulationVecId ( const State< TDataTypes > &  state)
inlineexplicit

◆ AccumulationVecId() [2/2]

template<class TDataTypes , VecType vtype, VecAccess vaccess>
sofa::core::AccumulationVecId< TDataTypes, vtype, vaccess >::AccumulationVecId ( )
delete

Function details

◆ addToContributingVecIds()

template<class TDataTypes , VecType vtype, VecAccess vaccess>
void sofa::core::AccumulationVecId< TDataTypes, vtype, vaccess >::addToContributingVecIds ( core::ConstVecDerivId  vecDerivId)

The provided VecDerivId container will contribute in the cumulative sum.

◆ operator[]()

template<class TDataTypes , VecType vtype, VecAccess vaccess>
TDataTypes::Deriv sofa::core::AccumulationVecId< TDataTypes, vtype, vaccess >::operator[] ( Size  i) const

◆ removeFromContributingVecIds()

template<class TDataTypes , VecType vtype, VecAccess vaccess>
void sofa::core::AccumulationVecId< TDataTypes, vtype, vaccess >::removeFromContributingVecIds ( core::ConstVecDerivId  vecDerivId)