MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <LocalDataElement.h>
Public Member Functions | |
Element * | copyElement (Id newParent, Id newId, unsigned int n, bool toGlobal) const |
unsigned int | getNode (unsigned int dataId) const |
Inherited virtual. Returns node location of specified object. More... | |
unsigned int | getNumOnNode (unsigned int node) const |
Inherited virtual. More... | |
bool | isGlobal () const |
Inherited virtual. Reports if this is Global, which it isn't. More... | |
LocalDataElement (Id id, const Cinfo *c, const string &name, unsigned int numData=1) | |
LocalDataElement (Id id, const Element *orig, unsigned int n) | |
unsigned int | localDataStart () const |
Inherited virtual. Returns index of first entry on this node. More... | |
unsigned int | numData () const |
Inherited virtual. Returns number of data entries over all nodes. More... | |
unsigned int | rawIndex (unsigned int dataId) const |
Converts dataId to index on current node. More... | |
void | resize (unsigned int newNumData) |
unsigned int | setDataSize (unsigned int numData) |
unsigned int | startDataIndex (unsigned int node) const |
Inherited virtual. Returns start DataIndex on specified node. More... | |
~LocalDataElement () | |
![]() | |
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 | 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) |
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 |
int | getTick () const |
bool | hasMsgs (BindIndex b) const |
Id | id () const |
void | innerSetTick (unsigned int tick) |
bool | isDoomed () const |
void | markAsDoomed () |
void | markRewired () |
const vector< MsgDigest > & | msgDigest (unsigned int index) |
const vector< ObjId > & | msgIn () const |
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) |
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 | ~Element () |
Private Attributes | |
unsigned int | localDataStart_ |
unsigned int | numData_ |
unsigned int | numPerNode_ |
Additional Inherited Members | |
![]() | |
static void | destroyElementTree (const vector< Id > &tree) |
This is the class for handling the local portion of a data element that is distributed over many nodes. Does block-wise partitioning between nodes.
Definition at line 20 of file LocalDataElement.h.
LocalDataElement::LocalDataElement | ( | Id | id, |
const Cinfo * | c, | ||
const string & | name, | ||
unsigned int | numData = 1 |
||
) |
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.
Referenced by copyElement().
This constructor copies over the original n times. It is used for doing all copies, in Shell::innerCopyElements.
Definition at line 28 of file LocalDataElement.cpp.
LocalDataElement::~LocalDataElement | ( | ) |
|
virtual |
Virtual copier. Makes a copy of self.
Implements Element.
Definition at line 41 of file LocalDataElement.cpp.
References LocalDataElement().
|
virtual |
Inherited virtual. Returns node location of specified object.
Implements Element.
Definition at line 72 of file LocalDataElement.cpp.
References ALLDATA, Shell::myNode(), DataElement::numLocalData(), and numPerNode_.
|
virtual |
Inherited virtual.
Implements Element.
Definition at line 121 of file LocalDataElement.cpp.
References numData(), numData_, and numPerNode_.
|
inlinevirtual |
Inherited virtual. Reports if this is Global, which it isn't.
Implements Element.
Definition at line 73 of file LocalDataElement.h.
|
virtual |
Inherited virtual. Returns index of first entry on this node.
Implements Element.
Definition at line 64 of file LocalDataElement.cpp.
References localDataStart_.
|
virtual |
Inherited virtual. Returns number of data entries over all nodes.
Implements Element.
Definition at line 59 of file LocalDataElement.cpp.
References numData_.
Referenced by getNumOnNode(), and setDataSize().
|
virtual |
Converts dataId to index on current node.
Implements Element.
Definition at line 93 of file LocalDataElement.cpp.
References numPerNode_.
|
virtual |
the data() function is inherited from DataElement and used as is. 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.
Reimplemented from DataElement.
Definition at line 116 of file LocalDataElement.cpp.
References DataElement::resize(), and setDataSize().
unsigned int LocalDataElement::setDataSize | ( | unsigned int | numData | ) |
Definition at line 101 of file LocalDataElement.cpp.
References localDataStart_, Shell::myNode(), numData(), numData_, Shell::numNodes(), and numPerNode_.
Referenced by resize().
|
virtual |
Inherited virtual. Returns start DataIndex on specified node.
Inherited virtual. Returns start DataId on specified node.
Implements Element.
Definition at line 85 of file LocalDataElement.cpp.
References numData_, and numPerNode_.
|
private |
Precomputed value for start index of data on this node.
Definition at line 121 of file LocalDataElement.h.
Referenced by localDataStart(), and setDataSize().
|
private |
This is the total number of data entries on this Element, in the entire simulation. Note that these entries do not have to be on this node, some may be farmed out to other nodes.
Definition at line 109 of file LocalDataElement.h.
Referenced by getNumOnNode(), numData(), setDataSize(), and startDataIndex().
|
private |
This is the number of data entries per node, except for possibly the last node if they don't divide evenly. Useful for intermediate calculations.
Definition at line 116 of file LocalDataElement.h.
Referenced by getNode(), getNumOnNode(), rawIndex(), setDataSize(), and startDataIndex().