MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SrcFinfo1< T > Class Template Reference

#include <SrcFinfo.h>

+ Inheritance diagram for SrcFinfo1< T >:
+ Collaboration diagram for SrcFinfo1< T >:

Public Member Functions

string rttiType () const
 
void send (const Eref &er, T arg) const
 
void sendBuffer (const Eref &e, double *buf) const
 
void sendTo (const Eref &er, Id tgt, T arg) const
 
void sendVec (const Eref &er, const vector< T > &arg) const
 
 SrcFinfo1 (const string &name, const string &doc)
 
 ~SrcFinfo1 ()
 
- Public Member Functions inherited from SrcFinfo
bool addMsg (const Finfo *target, ObjId mid, Element *src) const
 
bool checkTarget (const Finfo *target) const
 
BindIndex getBindIndex () const
 
void registerFinfo (Cinfo *c)
 
void setBindIndex (BindIndex b)
 
 SrcFinfo (const string &name, const string &doc)
 
bool strGet (const Eref &tgt, const string &field, string &returnValue) const
 
bool strSet (const Eref &tgt, const string &field, const string &arg) const
 
 ~SrcFinfo ()
 
- Public Member Functions inherited from Finfo
const string & docs () const
 Returns documentation string. More...
 
 Finfo (const string &name, const string &doc)
 
virtual vector< string > innerDest () const
 
virtual vector< string > innerSrc () const
 
const string & name () const
 
virtual void postCreationFunc (Id newId, Element *newElm) const
 
virtual ~Finfo ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Finfo
static const CinfoinitCinfo ()
 
- Static Public Attributes inherited from SrcFinfo
static const BindIndex BadBindIndex = 65535
 

Detailed Description

template<class T>
class SrcFinfo1< T >

Definition at line 97 of file SrcFinfo.h.

Constructor & Destructor Documentation

template<class T>
SrcFinfo1< T >::~SrcFinfo1 ( )
inline

Definition at line 100 of file SrcFinfo.h.

100 {;}
template<class T>
SrcFinfo1< T >::SrcFinfo1 ( const string &  name,
const string &  doc 
)
inline

Definition at line 102 of file SrcFinfo.h.

103  : SrcFinfo( name, doc )
104  { ; }
SrcFinfo(const string &name, const string &doc)
Definition: SrcFinfo.cpp:18
const string & name() const
Definition: Finfo.cpp:80

Member Function Documentation

template<class T>
string SrcFinfo1< T >::rttiType ( ) const
inlinevirtual

Returns the documentation string for the Finfo string docs() const; Returns the RTTI type string for the finfo by referring to an internal virtual function. string type() const; Returns the list of subsidiary SrcFinfos. Used in Shared Finfos, empty otherwise. Goes via internal virtual function. vector< string > src() const; Returns the list of subsidiary destFinfos. Used in SharedFinfos and ValueFinfos, empty otherwise. Goes via internal virtual function. vector< string > dest() const; Returns an RTTI type string for this Finfo.

Reimplemented from Finfo.

Definition at line 210 of file SrcFinfo.h.

References Conv< T >::rttiType().

210  {
211  return Conv<T>::rttiType();
212  }
static string rttiType()
Definition: Conv.h:82

+ Here is the call graph for this function:

template<class T>
void SrcFinfo1< T >::send ( const Eref er,
arg 
) const
inline

Definition at line 106 of file SrcFinfo.h.

References ALLDATA, SrcFinfo::getBindIndex(), Element::localDataStart(), Eref::msgDigest(), Element::numLocalData(), and OpFunc1Base< A >::op().

Referenced by SrcFinfo1< T >::sendBuffer(), testCreateMsg(), testSendMsg(), testSharedMsg(), Pool::vProcess(), and Pool::vReinit().

107  {
108  const vector< MsgDigest >& md = er.msgDigest( getBindIndex() );
109  for ( vector< MsgDigest >::const_iterator
110  i = md.begin(); i != md.end(); ++i ) {
111  const OpFunc1Base< T >* f =
112  dynamic_cast< const OpFunc1Base< T >* >( i->func );
113  assert( f );
114  for ( vector< Eref >::const_iterator
115  j = i->targets.begin(); j != i->targets.end(); ++j ) {
116  if ( j->dataIndex() == ALLDATA ) {
117  Element* e = j->element();
118  unsigned int start = e->localDataStart();
119  unsigned int end = start + e->numLocalData();
120  for ( unsigned int k = start; k < end; ++k )
121  f->op( Eref( e, k ), arg );
122  } else {
123  f->op( *j, arg );
124  // Need to send stuff offnode too here. The
125  // target in this case is just the src Element.
126  // Its ObjId gets stuffed into the send buf.
127  // On the other node it will execute
128  // its own send command with the passed in args.
129  }
130  }
131  }
132  }
virtual void op(const Eref &e, A arg) const =0
BindIndex getBindIndex() const
Definition: SrcFinfo.cpp:28
const unsigned int ALLDATA
Used by ObjId and Eref.
Definition: consts.cpp:22
const vector< MsgDigest > & msgDigest(unsigned int bindIndex) const
Definition: Eref.cpp:67
Definition: Eref.h:26
virtual unsigned int localDataStart() const =0
Returns index of first data entry on this node.
virtual unsigned int numLocalData() const =0
Returns number of local data entries on this node.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T>
void SrcFinfo1< T >::sendBuffer ( const Eref e,
double *  buf 
) const
inlinevirtual

Sends contents of buffer on to msg targets Buffer has a header with the TgtInfo.

Implements SrcFinfo.

Definition at line 205 of file SrcFinfo.h.

References SrcFinfo1< T >::send().

206  {
207  send( e, Conv< T >::buf2val( &buf ) );
208  }
void send(const Eref &er, T arg) const
Definition: SrcFinfo.h:106
Definition: Conv.h:30

+ Here is the call graph for this function:

template<class T>
void SrcFinfo1< T >::sendTo ( const Eref er,
Id  tgt,
arg 
) const
inline

Definition at line 134 of file SrcFinfo.h.

References ALLDATA, Id::element(), SrcFinfo::getBindIndex(), Element::localDataStart(), Eref::msgDigest(), Element::numLocalData(), and OpFunc1Base< A >::op().

135  {
136  const vector< MsgDigest >& md = er.msgDigest( getBindIndex() );
137  for ( vector< MsgDigest >::const_iterator
138  i = md.begin(); i != md.end(); ++i ) {
139  const OpFunc1Base< T >* f =
140  dynamic_cast< const OpFunc1Base< T >* >( i->func );
141  assert( f );
142  for ( vector< Eref >::const_iterator
143  j = i->targets.begin(); j != i->targets.end(); ++j ) {
144  if ( j->element() != tgt.element() )
145  continue; // Wasteful unless very few dests.
146  if ( j->dataIndex() == ALLDATA ) {
147  Element* e = j->element();
148  unsigned int start = e->localDataStart();
149  unsigned int end = start + e->numLocalData();
150  for ( unsigned int k = start; k < end; ++k )
151  f->op( Eref( e, k ), arg );
152  } else {
153  f->op( *j, arg );
154  // Need to send stuff offnode too here. The
155  // target in this case is just the src Element.
156  // Its ObjId gets stuffed into the send buf.
157  // On the other node it will execute
158  // its own send command with the passed in args.
159  }
160  }
161  }
162  }
virtual void op(const Eref &e, A arg) const =0
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
BindIndex getBindIndex() const
Definition: SrcFinfo.cpp:28
const unsigned int ALLDATA
Used by ObjId and Eref.
Definition: consts.cpp:22
const vector< MsgDigest > & msgDigest(unsigned int bindIndex) const
Definition: Eref.cpp:67
Definition: Eref.h:26
virtual unsigned int localDataStart() const =0
Returns index of first data entry on this node.
virtual unsigned int numLocalData() const =0
Returns number of local data entries on this node.

+ Here is the call graph for this function:

template<class T>
void SrcFinfo1< T >::sendVec ( const Eref er,
const vector< T > &  arg 
) const
inline

Each target gets successive entries from the arg vector. Rolls over if the # of targets exceeds vector size. Fails totally if the targets are off-node.

Definition at line 169 of file SrcFinfo.h.

References ALLDATA, SrcFinfo::getBindIndex(), Element::localDataStart(), Eref::msgDigest(), Element::numLocalData(), and OpFunc1Base< A >::op().

170  {
171  if ( arg.size() == 0 )
172  return;
173  const vector< MsgDigest >& md = er.msgDigest( getBindIndex() );
174  unsigned int argPos = 0;
175  for ( vector< MsgDigest >::const_iterator
176  i = md.begin(); i != md.end(); ++i ) {
177  const OpFunc1Base< T >* f =
178  dynamic_cast< const OpFunc1Base< T >* >( i->func );
179  assert( f );
180  for ( vector< Eref >::const_iterator
181  j = i->targets.begin(); j != i->targets.end(); ++j ) {
182  if ( j->dataIndex() == ALLDATA ) {
183  Element* e = j->element();
184  unsigned int start = e->localDataStart();
185  unsigned int end = start + e->numLocalData();
186  for ( unsigned int k = start; k < end; ++k ) {
187  f->op( Eref( e, k ), arg[ argPos++ ] );
188  if ( argPos >= arg.size() )
189  argPos = 0;
190  }
191  } else {
192  f->op( *j, arg[ argPos++ ] );
193  if ( argPos >= arg.size() )
194  argPos = 0;
195  // Need to send stuff offnode too here. The
196  // target in this case is just the src Element.
197  // Its ObjId gets stuffed into the send buf.
198  // On the other node it will execute
199  // its own send command with the passed in args.
200  }
201  }
202  }
203  }
virtual void op(const Eref &e, A arg) const =0
BindIndex getBindIndex() const
Definition: SrcFinfo.cpp:28
const unsigned int ALLDATA
Used by ObjId and Eref.
Definition: consts.cpp:22
const vector< MsgDigest > & msgDigest(unsigned int bindIndex) const
Definition: Eref.cpp:67
Definition: Eref.h:26
virtual unsigned int localDataStart() const =0
Returns index of first data entry on this node.
virtual unsigned int numLocalData() const =0
Returns number of local data entries on this node.

+ Here is the call graph for this function:


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