MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SrcFinfo2< T1, T2 > Class Template Reference

#include <SrcFinfo.h>

+ Inheritance diagram for SrcFinfo2< T1, T2 >:
+ Collaboration diagram for SrcFinfo2< T1, T2 >:

Public Member Functions

string rttiType () const
 
void send (const Eref &e, const T1 &arg1, const T2 &arg2) const
 
void sendBuffer (const Eref &e, double *buf) const
 
void sendTo (const Eref &e, Id tgt, const T1 &arg1, const T2 &arg2) const
 
 SrcFinfo2 (const string &name, const string &doc)
 
 ~SrcFinfo2 ()
 
- 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 T1, class T2>
class SrcFinfo2< T1, T2 >

Definition at line 219 of file SrcFinfo.h.

Constructor & Destructor Documentation

template<class T1, class T2>
SrcFinfo2< T1, T2 >::~SrcFinfo2 ( )
inline

Definition at line 222 of file SrcFinfo.h.

222 {;}
template<class T1, class T2>
SrcFinfo2< T1, T2 >::SrcFinfo2 ( const string &  name,
const string &  doc 
)
inline

Definition at line 224 of file SrcFinfo.h.

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

Member Function Documentation

template<class T1, class T2>
string SrcFinfo2< T1, T2 >::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 288 of file SrcFinfo.h.

References Conv< T >::rttiType().

288  {
289  return Conv<T1>::rttiType() + "," + Conv< T2 >::rttiType();
290  }
static string rttiType()
Definition: Conv.h:82

+ Here is the call graph for this function:

template<class T1, class T2>
void SrcFinfo2< T1, T2 >::send ( const Eref e,
const T1 &  arg1,
const T2 &  arg2 
) const
inline

Definition at line 228 of file SrcFinfo.h.

References ALLDATA, Eref::element(), SrcFinfo::getBindIndex(), Element::localDataStart(), Eref::msgDigest(), Element::numData(), and OpFunc2Base< A1, A2 >::op().

Referenced by SrcFinfo2< T1, T2 >::sendBuffer(), testSharedMsg(), MMenz::vProcess(), Reac::vProcess(), and Enz::vProcess().

229  {
230  const vector< MsgDigest >& md = e.msgDigest( getBindIndex() );
231  for ( vector< MsgDigest >::const_iterator
232  i = md.begin(); i != md.end(); ++i ) {
233  const OpFunc2Base< T1, T2 >* f =
234  dynamic_cast< const OpFunc2Base< T1, T2 >* >( i->func );
235  assert( f );
236  for ( vector< Eref >::const_iterator
237  j = i->targets.begin(); j != i->targets.end(); ++j ) {
238  if ( j->dataIndex() == ALLDATA ) {
239  Element* e = j->element();
240  unsigned int start = e->localDataStart();
241  unsigned int end = start + e->numData();
242  for ( unsigned int k = start; k < end; ++k )
243  f->op( Eref( e, k ), arg1, arg2 );
244  } else {
245  f->op( *j, arg1, arg2 );
246  }
247  }
248  }
249  }
BindIndex getBindIndex() const
Definition: SrcFinfo.cpp:28
Element * element() const
Definition: Eref.h:42
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
virtual void op(const Eref &e, A1 arg1, A2 arg2) const =0
Definition: Eref.h:26
virtual unsigned int numData() const =0
Returns number of data entries across all nodes.
virtual unsigned int localDataStart() const =0
Returns index of first data entry on this node.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T1, class T2>
void SrcFinfo2< T1, T2 >::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 277 of file SrcFinfo.h.

References Conv< T >::buf2val(), and SrcFinfo2< T1, T2 >::send().

278  {
279  // Note that buf2val alters the buf ptr as a side-effect, in
280  // order to advance to the next argument. However, the order
281  // in which argument evaluation is called within a multi-
282  // argument function is undefined. So we have to explicitly
283  // ensure the ordering of argument calls.
284  const T1& arg1 = Conv< T1 >::buf2val( &buf );
285  send( e, arg1, Conv< T2 >::buf2val( &buf ) );
286  }
Definition: Conv.h:30
void send(const Eref &e, const T1 &arg1, const T2 &arg2) const
Definition: SrcFinfo.h:228
static const T & buf2val(double **buf)
Definition: Conv.h:44

+ Here is the call graph for this function:

template<class T1, class T2>
void SrcFinfo2< T1, T2 >::sendTo ( const Eref e,
Id  tgt,
const T1 &  arg1,
const T2 &  arg2 
) const
inline

Definition at line 251 of file SrcFinfo.h.

References ALLDATA, Eref::element(), Id::element(), SrcFinfo::getBindIndex(), Element::localDataStart(), Eref::msgDigest(), Element::numData(), and OpFunc2Base< A1, A2 >::op().

253  {
254  const vector< MsgDigest >& md = e.msgDigest( getBindIndex() );
255  for ( vector< MsgDigest >::const_iterator
256  i = md.begin(); i != md.end(); ++i ) {
257  const OpFunc2Base< T1, T2 >* f =
258  dynamic_cast< const OpFunc2Base< T1, T2 >* >( i->func );
259  assert( f );
260  for ( vector< Eref >::const_iterator
261  j = i->targets.begin(); j != i->targets.end(); ++j ) {
262  if ( j->element() != tgt.element() )
263  continue; // Wasteful unless very few dests.
264  if ( j->dataIndex() == ALLDATA ) {
265  Element* e = j->element();
266  unsigned int start = e->localDataStart();
267  unsigned int end = start + e->numData();
268  for ( unsigned int k = start; k < end; ++k )
269  f->op( Eref( e, k ), arg1, arg2 );
270  } else {
271  f->op( *j, arg1, arg2 );
272  }
273  }
274  }
275  }
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
BindIndex getBindIndex() const
Definition: SrcFinfo.cpp:28
Element * element() const
Definition: Eref.h:42
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
virtual void op(const Eref &e, A1 arg1, A2 arg2) const =0
Definition: Eref.h:26
virtual unsigned int numData() const =0
Returns number of data entries across all nodes.
virtual unsigned int localDataStart() const =0
Returns index of first data entry on this node.

+ Here is the call graph for this function:


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