MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <DataElement.h>
Public Member Functions | |
char * | data (unsigned int rawIndex, unsigned int fieldIndex=0) const |
DataElement (Id id, const Cinfo *c, const string &name, unsigned int numData=1) | |
DataElement (Id id, const Element *orig, unsigned int n, unsigned int startEntry) | |
bool | hasFields () const |
Do not define getNode() or rawIndex() funcs, those are derived. More... | |
unsigned int | numField (unsigned int rawIndex) const |
Define only in derived classes: getNode( unsigned int dataIndex ) const;. More... | |
unsigned int | numLocalData () const |
Defined only in derived classes: unsigned int numData() const;. More... | |
void | resize (unsigned int newNumData) |
void | resizeField (unsigned int rawIndex, unsigned int newNumField) |
unsigned int | totNumLocalField () const |
void | zombieSwap (const Cinfo *newCinfo) |
Virtual func. More... | |
~DataElement () | |
![]() | |
void | addMsg (ObjId mid) |
void | addMsgAndFunc (ObjId mid, FuncId fid, BindIndex bindIndex) |
const Cinfo * | cinfo () const |
void | clearAllMsgs () |
Used upon ending of MOOSE session, to rapidly clear out messages. More... | |
void | clearBinding (BindIndex b) |
virtual Element * | copyElement (Id newParent, Id newId, unsigned int n, bool toGlobal) const =0 |
void | digestMessages () |
void | dropAllMsgsFromSrc (Id src) |
void | dropMsg (ObjId mid) |
Element (Id id, const Cinfo *c, const string &name) | |
unsigned int | findBinding (MsgFuncBinding b) const |
ObjId | findCaller (FuncId fid) const |
unsigned int | getFieldsOfOutgoingMsg (ObjId mid, vector< pair< BindIndex, FuncId > > &ret) const |
unsigned int | getInputMsgs (vector< ObjId > &caller, FuncId fid) const |
unsigned int | getInputsWithTgtIndex (vector< pair< Id, unsigned int > > &ret, const DestFinfo *finfo) const |
const vector< MsgFuncBinding > * | getMsgAndFunc (BindIndex b) const |
unsigned int | getMsgSourceAndSender (FuncId fid, vector< ObjId > &src, vector< string > &sender) const |
unsigned int | getMsgTargetAndFunctions (DataId srcDataId, const SrcFinfo *finfo, vector< ObjId > &tgt, vector< string > &func) const |
vector< ObjId > | getMsgTargets (DataId srcDataId, const SrcFinfo *finfo) const |
const string & | getName () const |
unsigned int | getNeighbors (vector< Id > &ret, const Finfo *finfo) const |
virtual unsigned int | getNode (unsigned int dataIndex) const =0 |
Returns node number of specified dataIndex. More... | |
virtual unsigned int | getNumOnNode (unsigned int node) const =0 |
int | getTick () const |
bool | hasMsgs (BindIndex b) const |
Id | id () const |
void | innerSetTick (unsigned int tick) |
bool | isDoomed () const |
virtual bool | isGlobal () const =0 |
True if there is a copy of every dataEntry on all nodes. More... | |
virtual unsigned int | localDataStart () const =0 |
Returns index of first data entry on this node. More... | |
void | markAsDoomed () |
void | markRewired () |
const vector< MsgDigest > & | msgDigest (unsigned int index) |
const vector< ObjId > & | msgIn () const |
virtual unsigned int | numData () const =0 |
Returns number of data entries across all nodes. More... | |
void | printMsgDigest (unsigned int srcIndex, unsigned int dataIndex) const |
void | putOffNodeTargetsInDigest (unsigned int srcNum, vector< vector< bool > > &targetNodes) |
void | putTargetsInDigest (unsigned int srcNum, const MsgFuncBinding &mfb, const FuncOrder &fo, vector< vector< bool > > &targetNodes) |
virtual unsigned int | rawIndex (unsigned int dataIndex) const =0 |
void | replaceCinfo (const Cinfo *newCinfo) |
Support function for zombieSwap, replaces Cinfo. More... | |
void | setName (const string &val) |
void | setTick (int t) |
void | showFields () const |
void | showMsg () const |
virtual unsigned int | startDataIndex (unsigned int nodeNum) const =0 |
Returns start dataIndex on specified node. More... | |
virtual | ~Element () |
Private Attributes | |
char * | data_ |
unsigned int | numLocalData_ |
unsigned int | size_ |
Additional Inherited Members | |
![]() | |
static void | destroyElementTree (const vector< Id > &tree) |
This is the base class for managing the data in the MOOSE interface. Elaborates on base class for how it handles destruction. Subclasses of this handle special node decomposition. This does basic data management with raw indices.
Definition at line 21 of file DataElement.h.
This is the main constructor, used by Shell::innerCreate which makes most Elements. Also used to create base Elements to init the simulator in main.cpp. Id is the Id of the new Element Cinfo is the class name is its name numData is the number of data entries, defaults to a singleton. The isGlobal flag specifies whether the created objects should be replicated on all nodes, or partitioned without replication.
This constructor copies over the original n times. It is used for doing all copies, in Shell::innerCopyElements.
Definition at line 35 of file DataElement.cpp.
References Element::cinfo(), DinfoBase::copyData(), Element::data(), data_, Cinfo::dinfo(), Element::numData(), numLocalData_, size_, and DinfoBase::sizeIncrement().
DataElement::~DataElement | ( | ) |
Virtual Destructor
Definition at line 48 of file DataElement.cpp.
References Element::cinfo(), data_, DinfoBase::destroyData(), and Cinfo::dinfo().
|
virtual |
Inherited virtual. Looks up specified field data entry. On regular objects just returns the data entry specified by the rawIndex. On FieldElements like synapses, does a second lookup on the field index. Note that the index is NOT a DataIndex: it is instead the raw index of the data on the current node. Index is also NOT the character offset, but the index to the data array in whatever type the data may be.
The DataIndex has to be filtered through the nodeMap to find a) if the entry is here, and b) what its raw index is.
Returns 0 if either index is out of range.
Implements Element.
Definition at line 82 of file DataElement.cpp.
References data_, numLocalData_, and size_.
|
inlinevirtual |
Do not define getNode() or rawIndex() funcs, those are derived.
Inherited virtual True if this is a FieldElement having an array of fields on each data entry. Clearly not true for the base Element.
Implements Element.
Definition at line 81 of file DataElement.h.
|
virtual |
Define only in derived classes: getNode( unsigned int dataIndex ) const;.
Inherited virtual. Returns number of field entries for specified data
Implements Element.
Definition at line 67 of file DataElement.cpp.
|
virtual |
Defined only in derived classes: unsigned int numData() const;.
copyElement function is defined only in derived classes.Inherited virtual. Returns number of data entries on this node
Implements Element.
Definition at line 61 of file DataElement.cpp.
References numLocalData_.
Referenced by LocalDataElement::getNode(), GlobalDataElement::getNumOnNode(), and GlobalDataElement::numData().
|
virtual |
Inherited virtual. Changes the total number of data entries on Element in entire simulation. Not permitted for FieldElements since they are just fields on the data.
virtual func, overridden. Here we resize the local data. This function would be called by derived classes to do their own data management as per node decomposition.
Implements Element.
Reimplemented in LocalDataElement.
Definition at line 95 of file DataElement.cpp.
References Element::cinfo(), DinfoBase::copyData(), data_, DinfoBase::destroyData(), Cinfo::dinfo(), and numLocalData_.
Referenced by LocalDataElement::resize().
|
inlinevirtual |
Inherited virtual. Changes the number of fields on the specified data entry. Doesn't do anything for the regular Element.
Implements Element.
Definition at line 121 of file DataElement.h.
|
virtual |
Inherited virtual: Returns number of field entries on current node, same as numLocalData().
Implements Element.
Definition at line 73 of file DataElement.cpp.
References numLocalData_.
|
virtual |
Virtual func.
Reimplemented from Element.
Definition at line 109 of file DataElement.cpp.
References DinfoBase::allocData(), Element::cinfo(), data_, DinfoBase::destroyData(), Cinfo::dinfo(), numLocalData_, Element::replaceCinfo(), size_, DinfoBase::sizeIncrement(), and Element::zombieSwap().
|
private |
This points to an array holding the data for the Element.
Definition at line 136 of file DataElement.h.
Referenced by data(), DataElement(), resize(), zombieSwap(), and ~DataElement().
|
private |
This is the number of data entries on the current node.
Definition at line 141 of file DataElement.h.
Referenced by data(), DataElement(), numLocalData(), resize(), totNumLocalField(), and zombieSwap().
|
private |
This is the size of the data. Can get from cinfo()->dinfo(), but this is called so often than it makes a measurable difference.
Definition at line 148 of file DataElement.h.
Referenced by data(), DataElement(), and zombieSwap().