Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
CellVecData Class Reference

#include <CellVecData.hpp>

+ Inheritance diagram for CellVecData:
+ Collaboration diagram for CellVecData:

Public Member Functions

 CellVecData ()
 
 CellVecData (const CellVecData &rAnotherCellVecData)
 
 CellVecData (const std::map< std::string, Vec > &rCellVecDataMap)
 
virtual ~CellVecData ()
 
void SetItem (const std::string &rVariableName, Vec data)
 
Vec GetItem (const std::string &rVariableName) const
 
unsigned GetNumItems () const
 
std::vector< std::string > GetKeys () const
 
- Public Member Functions inherited from AbstractCellProperty
 AbstractCellProperty ()
 
virtual ~AbstractCellProperty ()
 
template<class CLASS >
bool IsType () const
 
template<class BASECLASS >
bool IsSubType () const
 
bool IsSame (const AbstractCellProperty *pOther) const
 
bool IsSame (boost::shared_ptr< const AbstractCellProperty > pOther) const
 
void IncrementCellCount ()
 
void DecrementCellCount ()
 
unsigned GetCellCount () const
 
- Public Member Functions inherited from Identifiable
virtual ~Identifiable ()
 
std::string GetIdentifier () const
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

std::map< std::string, VecmCellVecData
 
bool mFreeVecs
 

Friends

class boost::serialization::access
 

Detailed Description

CellVecData class.

This cell property allows each cell to store one or more 'named' PETSc Vec variables associated with it, for example solutions to reaction-diffusion PDEs solved within the cell. Other classes may interrogate or modify the values stored in this class.

Definition at line 62 of file CellVecData.hpp.

Constructor & Destructor Documentation

◆ CellVecData() [1/3]

CellVecData::CellVecData ( )

Default constructor

Definition at line 38 of file CellVecData.cpp.

◆ CellVecData() [2/3]

CellVecData::CellVecData ( const CellVecData rAnotherCellVecData)

Copy constructor used to perform a deep copy of rAnotherCellVecData

Parameters
rAnotherCellVecDatathe class to copy

Definition at line 43 of file CellVecData.cpp.

References GetItem(), GetKeys(), and mCellVecData.

◆ CellVecData() [3/3]

CellVecData::CellVecData ( const std::map< std::string, Vec > &  rCellVecDataMap)

Constructor required for serialisation. Avoid using otherwise.

Parameters
rCellVecDataMapthe internal map which needs to be copied

Definition at line 61 of file CellVecData.cpp.

◆ ~CellVecData()

CellVecData::~CellVecData ( )
virtual

We need the empty virtual destructor in this class to ensure Boost serialization works correctly with static libraries.

Definition at line 67 of file CellVecData.cpp.

References PetscTools::Destroy(), mCellVecData, and mFreeVecs.

Member Function Documentation

◆ GetItem()

Vec CellVecData::GetItem ( const std::string &  rVariableName) const
Returns
data.
Parameters
rVariableNamethe index of the data required. throws if rVariableName has not been stored

Definition at line 84 of file CellVecData.cpp.

References EXCEPTION, and mCellVecData.

Referenced by CellVecData().

◆ GetKeys()

std::vector< std::string > CellVecData::GetKeys ( ) const
Returns
all keys.

According to STL these are sorted in lexicographical/alphabetic order (so that the ordering here is predictable).

Definition at line 105 of file CellVecData.cpp.

References mCellVecData.

Referenced by CellVecData().

◆ GetNumItems()

unsigned CellVecData::GetNumItems ( ) const
Returns
number of data items

Definition at line 100 of file CellVecData.cpp.

References mCellVecData.

◆ serialize()

template<class Archive >
void CellVecData::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Archive the member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 85 of file CellVecData.hpp.

◆ SetItem()

void CellVecData::SetItem ( const std::string &  rVariableName,
Vec  data 
)

This assigns the cell data.

Parameters
rVariableNamethe name of the data to be set.
datathe value to set it to.

Definition at line 79 of file CellVecData.cpp.

References mCellVecData.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 77 of file CellVecData.hpp.

Member Data Documentation

◆ mCellVecData

std::map<std::string, Vec> CellVecData::mCellVecData
private

The cell data.

Definition at line 69 of file CellVecData.hpp.

Referenced by CellVecData(), ~CellVecData(), GetItem(), GetKeys(), GetNumItems(), and SetItem().

◆ mFreeVecs

bool CellVecData::mFreeVecs
private

Whether to free in the destructor the Vec stored in the map

Definition at line 74 of file CellVecData.hpp.

Referenced by ~CellVecData().


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