MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GlobalDataElement Class Reference

#include <GlobalDataElement.h>

+ Inheritance diagram for GlobalDataElement:
+ Collaboration diagram for GlobalDataElement:

Public Member Functions

ElementcopyElement (Id newParent, Id newId, unsigned int n, bool toGlobal) const
 
unsigned int getNode (unsigned int dataIndex) const
 Inherited virtual. Returns node location of specified object. More...
 
unsigned int getNumOnNode (unsigned int node) const
 Inherited virtual. More...
 
 GlobalDataElement (Id id, const Cinfo *c, const string &name, unsigned int numData=1)
 
 GlobalDataElement (Id id, const Element *orig, unsigned int n)
 
bool isGlobal () const
 True if there is a copy of every dataEntry on all nodes. More...
 
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. More...
 
unsigned int rawIndex (unsigned int dataId) const
 Converts dataId to index on current node. More...
 
unsigned int startDataIndex (unsigned int node) const
 Inherited virtual. Returns start dataIndex on specified node. More...
 
 ~GlobalDataElement ()
 
- Public Member Functions inherited from DataElement
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 ()
 
- Public Member Functions inherited from Element
void addMsg (ObjId mid)
 
void addMsgAndFunc (ObjId mid, FuncId fid, BindIndex bindIndex)
 
const Cinfocinfo () 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< ObjIdgetMsgTargets (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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Element
static void destroyElementTree (const vector< Id > &tree)
 

Detailed Description

This is the usual class for managing the MOOSE interface. Handles the data. Elaborates on base class for how it handles destruction. Does block-wise partitioning between nodes.

Definition at line 21 of file GlobalDataElement.h.

Constructor & Destructor Documentation

GlobalDataElement::GlobalDataElement ( 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. The isGlobal flag specifies whether the created objects should be replicated on all nodes, or partitioned without replication.

Referenced by copyElement().

+ Here is the caller graph for this function:

GlobalDataElement::GlobalDataElement ( Id  id,
const Element orig,
unsigned int  n 
)

This constructor copies over the original n times. It is used for doing all copies, in Shell::innerCopyElements.

Definition at line 28 of file GlobalDataElement.cpp.

30  :
31  DataElement( id, orig, n, 0 )
32 {;}
DataElement(Id id, const Cinfo *c, const string &name, unsigned int numData=1)
GlobalDataElement::~GlobalDataElement ( )

Virtual Destructor

Definition at line 35 of file GlobalDataElement.cpp.

36 {;}

Member Function Documentation

Element * GlobalDataElement::copyElement ( Id  newParent,
Id  newId,
unsigned int  n,
bool  toGlobal 
) const
virtual

Virtual copier. Makes a copy of self.

Implements Element.

Definition at line 38 of file GlobalDataElement.cpp.

References GlobalDataElement().

40 {
41  if ( toGlobal )
42  return new GlobalDataElement( newId, this, n );
43  else
44  return new LocalDataElement( newId, this, n );
45 }
GlobalDataElement(Id id, const Cinfo *c, const string &name, unsigned int numData=1)

+ Here is the call graph for this function:

unsigned int GlobalDataElement::getNode ( unsigned int  dataIndex) const
virtual

Inherited virtual. Returns node location of specified object.

Implements Element.

Definition at line 58 of file GlobalDataElement.cpp.

References Shell::myNode().

58  {
59  // Assume numData = 95. DataId = 0-9: 0, DataId=80-89:8, DataId >= 90:9
60  return Shell::myNode();
61 }
static unsigned int myNode()

+ Here is the call graph for this function:

unsigned int GlobalDataElement::getNumOnNode ( unsigned int  node) const
virtual

Inherited virtual.

Implements Element.

Definition at line 67 of file GlobalDataElement.cpp.

References DataElement::numLocalData().

68 {
69  return numLocalData();
70 }
unsigned int numLocalData() const
Defined only in derived classes: unsigned int numData() const;.
Definition: DataElement.cpp:61

+ Here is the call graph for this function:

bool GlobalDataElement::isGlobal ( ) const
inlinevirtual

True if there is a copy of every dataEntry on all nodes.

Implements Element.

Definition at line 79 of file GlobalDataElement.h.

79  {
80  return true;
81  }
unsigned int GlobalDataElement::localDataStart ( ) const
inlinevirtual

Inherited virtual. Returns index of first entry on this node.

Implements Element.

Definition at line 63 of file GlobalDataElement.h.

63  {
64  return 0;
65  }
unsigned int GlobalDataElement::numData ( ) const
virtual

Inherited virtual. Returns number of data entries.

Implements Element.

Definition at line 53 of file GlobalDataElement.cpp.

References DataElement::numLocalData().

54 {
55  return numLocalData();
56 }
unsigned int numLocalData() const
Defined only in derived classes: unsigned int numData() const;.
Definition: DataElement.cpp:61

+ Here is the call graph for this function:

unsigned int GlobalDataElement::rawIndex ( unsigned int  dataId) const
virtual

Converts dataId to index on current node.

Implements Element.

Definition at line 63 of file GlobalDataElement.cpp.

63  {
64  return dataId;
65 }
unsigned int GlobalDataElement::startDataIndex ( unsigned int  node) const
inlinevirtual

Inherited virtual. Returns start dataIndex on specified node.

Implements Element.

Definition at line 71 of file GlobalDataElement.h.

72  {
73  return 0;
74  }

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