SOFA API  1e111313
Open source framework for multi-physics simuation
sofa::helper::StateMask Class Reference

#include <StateMask.h>

Protected Attributes

size_t m_size
 

Public Member Functions

 StateMask ()
 
void assign (size_t size, bool)
 filling-up (and resizing when necessary) the mask More...
 
void activate (bool)
 
bool isActivated () const
 
void insertEntry (size_t)
 add the given dof index in the mask More...
 
bool getEntry (size_t) const
 
void resize (size_t size)
 getting mask entries is useful for advanced uses. More...
 
void clear ()
 
size_t size () const
 
size_t nbActiveDofs () const
 return the number of dofs in the mask More...
 
size_t getHash () const
 

Friends

std::ostream & operator<< (std::ostream &os, const StateMask &)
 

Attribute details

size_t sofa::helper::StateMask::m_size
protected

Constructor details

sofa::helper::StateMask::StateMask ( )
inline

Function details

void sofa::helper::StateMask::activate ( bool  )
inline

the mask can be deactivated when the mappings must be applied to every dofs (e.g. propagatePosition) it must be activated when the mappings can be limited to active dofs

void sofa::helper::StateMask::assign ( size_t  size,
bool   
)
inline

filling-up (and resizing when necessary) the mask

void sofa::helper::StateMask::clear ( )
inline
bool sofa::helper::StateMask::getEntry ( size_t  ) const
inline

is the given dof index in the mask?

Warning
always returns the mask value w/o checking if the mask is activated (ie do no forget to check if mask is activated in Mapping::applyJ)
size_t sofa::helper::StateMask::getHash ( ) const
inline
void sofa::helper::StateMask::insertEntry ( size_t  )
inline

add the given dof index in the mask

bool sofa::helper::StateMask::isActivated ( ) const
inline
size_t sofa::helper::StateMask::nbActiveDofs ( ) const
inline

return the number of dofs in the mask

filtering the given input matrix by using the mask as a diagonal projection matrix output = mask.asDiagonal() * input template<class Real> void maskedMatrix( Eigen::SparseMatrix<Real,Eigen::RowMajor>& output, const Eigen::SparseMatrix<Real,Eigen::RowMajor>& input, size_t blockSize=1 ) const {SOFA_UNUSED(blockSize); output=input;}

void sofa::helper::StateMask::resize ( size_t  size)
inline

getting mask entries is useful for advanced uses.

size_t sofa::helper::StateMask::size ( void  ) const
inline

Related details

std::ostream& operator<< ( std::ostream &  os,
const StateMask  
)
friend