MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Neutral.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2009 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #include "header.h"
11 #include "Dinfo.h"
12 #include "ElementValueFinfo.h"
14 #include "Shell.h"
15 
17 {
19  // Element Value Finfos
21 
23  "name",
24  "Name of object",
27 
28  // Should be renamed to myId
30  "me",
31  "ObjId for current object",
33 
35  "parent",
36  "Parent ObjId for current object",
38 
40  "children",
41  "vector of ObjIds listing all children of current object",
43 
45  "path",
46  "text path for object",
48 
49  /*
50  */
52  "className",
53  "Class Name of object",
55 
57  "numData",
58  "# of Data entries on Element."
59  "Note that on a FieldElement this does NOT refer to field entries,"
60  "but to the number of DataEntries on the parent of the "
61  "FieldElement.",
64 
66  "numField",
67  "For a FieldElement: number of entries of self."
68  "For a regular Element: One.",
71 
73  "idValue",
74  "Object id of self, converted to an unsigned int.",
75  &Neutral::getId );
76 
78  "index",
79  "For a FieldElement: Object index of parent."
80  "For a regular Element: Object index (dataId) of self.",
82 
84  "fieldIndex",
85  "For a FieldElement: field Index of self."
86  "For a regular Element: zero.",
88 
90  tick(
91  "tick",
92  "Clock tick for this Element for periodic execution in the "
93  "main simulation event loop. A default is normally assigned, "
94  "based on object class, but one can override to any value "
95  "between 0 and 19. Assigning to -1 means that the object is "
96  "disabled and will not be called during simulation execution "
97  "The actual timestep (dt) belonging to a clock tick is defined "
98  "by the Clock object.",
100  &Neutral::getTick );
101 
103  dt(
104  "dt",
105  "Timestep used for this Element. Zero if not scheduled.",
106  &Neutral::getDt );
107 
108 
110  valueFields(
111  "valueFields",
112  "List of all value fields on Element."
113  "These fields are accessed through the assignment operations "
114  "in the Python interface."
115  "These fields may also be accessed as functions through the "
116  "set<FieldName> and get<FieldName> commands.",
118  );
119 
121  sourceFields(
122  "sourceFields",
123  "List of all source fields on Element, that is fields that "
124  "can act as message sources. ",
126  );
127 
129  destFields(
130  "destFields",
131  "List of all destination fields on Element, that is, fields"
132  "that are accessed as Element functions.",
134  );
135 
137  "msgOut",
138  "Messages going out from this Element",
140 
142  "msgIn",
143  "Messages coming in to this Element",
145 
147  "neighbors",
148  "Ids of Elements connected this Element on specified field.",
150 
152  "msgDests",
153  "ObjIds receiving messages from the specified SrcFinfo",
155 
157  "msgDestFunctions",
158  "Matching function names for each ObjId receiving a msg from "
159  "the specified SrcFinfo",
161 
163  "isA",
164  "Returns true if the current object is derived from the specified "
165  "the specified class",
166  &Neutral::isA );
167 
169  // Value Finfos
171  static ValueFinfo< Neutral, Neutral > thisFinfo (
172  "this",
173  "Access function for entire object",
176  );
178  // SrcFinfos
180  static SrcFinfo1< int > childOut( "childOut",
181  "Message to child Elements");
182 
184  // DestFinfos
186  static DestFinfo parentMsg( "parentMsg",
187  "Message from Parent Element(s)",
189 
190  static DestFinfo blockNodeBalance( "blockNodeBalance",
191  "Request conversion of data into a blockDataHandler subclass,"
192  "and to carry out node balancing of data."
193  "The amount of data is not altered, and if the data is already a"
194  "blockDataHandler subclass it retains its original dimensions"
195  "If converting from a generalDataHandler to blockHandler it treats"
196  "it as a linear array"
197  "The function preserves the old data and shuffles info around"
198  "between nodes to complete the balancing."
199  "Arguments are: myNode, startNode, endNode",
202 
203  static DestFinfo generalNodeBalance( "generalNodeBalance",
204  "Request conversion of data into a generalDataHandler subclass,"
205  "and to carry out node balancing of data as per specified args."
206  "The amount of data is not altered. The generalDataHandler loses"
207  "any dimensional information that may have been present in an "
208  "earlier blockDataHandler incarnation."
209  "Arguments are: myNode, nodeAssignment",
210  new EpFunc2< Neutral, unsigned int, vector< unsigned int > >(
212 
214  // Setting up the Finfo list.
216  static Finfo* neutralFinfos[] = {
217  &childOut, // SrcFinfo
218  &parentMsg, // DestFinfo
219  &thisFinfo, // Value
220  &name, // Value
221  &me, // ReadOnlyValue
222  &parent, // ReadOnlyValue
223  &children, // ReadOnlyValue
224  &path, // ReadOnlyValue
225  &className, // ReadOnlyValue
226  &numData, // Value
227  &numField, // Value
228  &id, // ReadOnlyValue
229  &index, // ReadOnlyValue
230  &fieldIndex, // ReadOnlyValue
231  &tick, // Value
232  &dt, // ReadOnlyValue
233  &valueFields, // ReadOnlyValue
234  &sourceFields, // ReadOnlyValue
235  &destFields, // ReadOnlyValue
236  &msgOut, // ReadOnlyValue
237  &msgIn, // ReadOnlyValue
238  &neighbors, // ReadOnlyLookupValue
239  &msgDests, // ReadOnlyLookupValue
240  &msgDestFunctions, // ReadOnlyLookupValue
241  &isA, // ReadOnlyLookupValue
242  };
243 
245  // Setting up the Cinfo.
247 
248  static string doc[] =
249  {
250  "Name", "Neutral",
251  "Author", "Upinder S. Bhalla, 2007, NCBS",
252  "Description", "Neutral: Base class for all MOOSE classes. Provides"
253  "access functions for housekeeping fields and operations, message"
254  "traversal, and so on."
255  };
256  static Dinfo< Neutral > dinfo;
257  static Cinfo neutralCinfo (
258  "Neutral",
259  0, // No base class.
260  neutralFinfos,
261  sizeof( neutralFinfos ) / sizeof( Finfo* ),
262  &dinfo,
263  doc,
264  sizeof(doc)/sizeof(string)
265  );
266 
267  return &neutralCinfo;
268 }
269 
271 
272 
274  // : name_( "" )
275 {
276  ;
277 }
278 
280 // Access functions
282 
283 
285 {
286  ;
287 }
288 
290 {
291  return *this;
292 }
293 
294 void Neutral::setName( const Eref& e, string name )
295 {
296  if ( e.id().value() <= 3 ) {
297  cout << "Warning: Neutral::setName on '" << e.id().path() <<
298  "'. Cannot rename core objects\n";
299  return;
300  }
301  if ( !Shell::isNameValid( name ) ) {
302  cout << "Warning: Neutral::setName on '" << e.id().path() <<
303  "'. Illegal character in name.\n";
304  return;
305  }
306  ObjId pa = parent( e );
307  Id sibling = Neutral::child( pa.eref(), name );
308  if ( sibling == Id() ) { // OK, no existing object with same name.
309  e.element()->setName( name );
310  } else {
311  cout << "Warning: Neutral::setName: an object with the name '" <<
312  name << "'\n already exists on the same parent. Not changed\n";
313  }
314 }
315 
316 string Neutral::getName( const Eref& e ) const
317 {
318  return e.element()->getName();
319 }
320 
321 ObjId Neutral::getObjId( const Eref& e ) const
322 {
323  return e.objId();
324 }
325 
326 ObjId Neutral::getParent( const Eref& e ) const
327 {
328  return parent( e );
329 }
330 
334 vector< Id > Neutral::getChildren( const Eref& e ) const
335 {
336  vector< Id > ret;
337  children( e, ret );
338  return ret;
339 }
340 
341 // Static function
342 void Neutral::children( const Eref& e, vector< Id >& ret )
343 {
344  /*
345  vector< Id > temp;
346  getNeighbors( ret, neutralCinfo->findFinfo( "childOut" ) );
347  for ( vector< Id >::iterator i = temp.begin(); i != temp.end(); ++i ) {
348  if ( ret
349  }
350  */
351 
352 
353 
354  static const Finfo* pf = neutralCinfo->findFinfo( "parentMsg" );
355  static const DestFinfo* pf2 = dynamic_cast< const DestFinfo* >( pf );
356  static const FuncId pafid = pf2->getFid();
357  static const Finfo* cf = neutralCinfo->findFinfo( "childOut" );
358  static const SrcFinfo* cf2 = dynamic_cast< const SrcFinfo* >( cf );
359  static const BindIndex bi = cf2->getBindIndex();
360 
361  const vector< MsgFuncBinding >* bvec = e.element()->getMsgAndFunc( bi );
362 
363  for ( vector< MsgFuncBinding >::const_iterator i = bvec->begin();
364  i != bvec->end(); ++i ) {
365  if ( i->fid == pafid ) {
366  const Msg* m = Msg::getMsg( i->mid );
367  assert( m );
368  vector< vector< Eref > > kids;
369  m->targets( kids );
370  if ( e.dataIndex() == ALLDATA ) {
371  for ( vector< vector< Eref > >::iterator
372  i = kids.begin(); i != kids.end(); ++i ) {
373  for ( vector< Eref >::iterator
374  j = i->begin(); j != i->end(); ++j )
375  ret.push_back( j->id() );
376  }
377  } else {
378  const vector< Eref >& temp = kids[e.dataIndex()];
379  for ( vector< Eref >::const_iterator
380  i = temp.begin(); i != temp.end(); ++i )
381  ret.push_back( i->id() );
382  }
383  }
384  }
385 }
386 
387 
388 string Neutral::getPath( const Eref& e ) const
389 {
390  return path( e );
391 }
392 
393 string Neutral::getClass( const Eref& e ) const
394 {
395  return e.element()->cinfo()->name();
396 }
397 
398 unsigned int Neutral::getNumData( const Eref& e ) const
399 {
400  return e.element()->numData();
401 }
402 
403 void Neutral::setNumData( const Eref& e, unsigned int num )
404 {
405  e.element()->resize( num );
406 }
407 
408 unsigned int Neutral::getNumField( const Eref& e ) const
409 {
410  assert( e.isDataHere() );
411  unsigned int rawIndex = e.element()->rawIndex( e.dataIndex() );
412  return e.element()->numField( rawIndex );
413 }
414 
415 void Neutral::setNumField( const Eref& e, unsigned int num )
416 {
417  assert( e.isDataHere() );
418  unsigned int rawIndex = e.element()->rawIndex( e.dataIndex() );
419  e.element()->resizeField( rawIndex, num );
420 }
421 
422 unsigned int Neutral::getId( const Eref& e ) const
423 {
424  return e.id().value();
425 }
426 
427 unsigned int Neutral::getIndex( const Eref& e ) const
428 {
429  return e.dataIndex();
430 }
431 
432 unsigned int Neutral::getFieldIndex( const Eref& e ) const
433 {
434  return e.fieldIndex();
435 }
436 
437 int Neutral::getTick( const Eref& e ) const
438 {
439  return e.element()->getTick();
440 }
441 
442 void Neutral::setTick( const Eref& e, int num )
443 {
444  e.element()->setTick( num );
445 }
446 
447 double Neutral::getDt( const Eref& e ) const
448 {
449  int tick = e.element()->getTick();
450  if ( tick < 0 )
451  return 0.0;
452  Id clockId( 1 );
454  clockId, "tickDt", tick );
455 }
456 
457 vector< string > Neutral::getValueFields( const Eref& e ) const
458 {
459  unsigned int num = e.element()->cinfo()->getNumValueFinfo();
460  vector< string > ret( num );
461  for ( unsigned int i = 0; i < num; ++i ) {
462  const Finfo *f = e.element()->cinfo()->getValueFinfo( i );
463  assert( f );
464  ret[i] = f->name();
465  }
466  return ret;
467 }
468 
469 vector< string > Neutral::getSourceFields( const Eref& e ) const
470 {
471  unsigned int num = e.element()->cinfo()->getNumSrcFinfo();
472  vector< string > ret( num );
473  for ( unsigned int i = 0; i < num; ++i ) {
474  const Finfo *f = e.element()->cinfo()->getSrcFinfo( i );
475  assert( f );
476  ret[i] = f->name();
477  }
478  return ret;
479 }
480 
481 vector< string > Neutral::getDestFields( const Eref& e ) const
482 {
483  unsigned int num = e.element()->cinfo()->getNumDestFinfo();
484  vector< string > ret( num );
485  for ( unsigned int i = 0; i < num; ++i ) {
486  const Finfo *f = e.element()->cinfo()->getDestFinfo( i );
487  assert( f );
488  ret[i] = f->name();
489  }
490  return ret;
491 }
492 
493 vector< ObjId > Neutral::getOutgoingMsgs( const Eref& e ) const
494 {
495  vector< ObjId > ret;
496  unsigned int numBindIndex = e.element()->cinfo()->numBindIndex();
497 
498  for ( unsigned int i = 0; i < numBindIndex; ++i ) {
499  const vector< MsgFuncBinding >* v =
500  e.element()->getMsgAndFunc( i );
501  if ( v ) {
502  for ( vector< MsgFuncBinding >::const_iterator mb = v->begin();
503  mb != v->end(); ++mb ) {
504  ret.push_back( mb->mid );
505  }
506  }
507  }
508  return ret;
509 }
510 
511 vector< ObjId > Neutral::getIncomingMsgs( const Eref& e ) const
512 {
513  vector< ObjId > ret;
514  const vector< ObjId >& msgIn = e.element()->msgIn();
515 
516  for (unsigned int i = 0; i < msgIn.size(); ++i ) {
517  const Msg* m = Msg::getMsg( msgIn[i] );
518  assert( m );
519  if ( m->e2() == e.element() )
520  ret.push_back( m->mid() );
521  }
522  return ret;
523 }
524 
525 vector< Id > Neutral::getNeighbors( const Eref& e, string field ) const
526 {
527  vector< Id > ret;
528  const Finfo* finfo = e.element()->cinfo()->findFinfo( field );
529  if ( finfo )
530  e.element()->getNeighbors( ret, finfo );
531  else
532  cout << "Warning: Neutral::getNeighbors: Id.Field '" <<
533  e.id().path() << "." << field <<
534  "' not found\n";
535  return ret;
536 }
537 
538 vector< ObjId > Neutral::getMsgDests( const Eref& e, string field ) const
539 {
540  const Finfo* finfo = e.element()->cinfo()->findFinfo( field );
541  const SrcFinfo* sf = dynamic_cast< const SrcFinfo* >( finfo );
542  if ( sf ) {
543  vector< ObjId > tgt;
544  vector< string > func;
546  tgt, func );
547  return tgt;
548  } else {
549  cout << "Warning: Neutral::getMsgDests: Id.Field '" <<
550  e.id().path() << "." << field <<
551  "' not found or not a SrcFinfo\n";
552  }
553  static vector< ObjId > ret( 0 );
554  return ret;
555 }
556 
557 vector< string > Neutral::getMsgDestFunctions( const Eref& e, string field ) const
558 {
559  vector< string > ret( 0 );
560  const Finfo* finfo = e.element()->cinfo()->findFinfo( field );
561  const SrcFinfo* sf = dynamic_cast< const SrcFinfo* >( finfo );
562  if ( sf ) {
563  vector< ObjId > tgt;
564  vector< string > func;
566  tgt, func );
567  return func;
568  } else {
569  cout << "Warning: Neutral::getMsgDestFunctions: Id.Field '" <<
570  e.id().path() << "." << field <<
571  "' not found or not a SrcFinfo\n";
572  }
573  return ret;
574 }
575 
576 bool Neutral::isA( const Eref& e, string className ) const
577 {
578  return e.element()->cinfo()->isA( className );
579 }
580 
582 
583 unsigned int Neutral::buildTree( const Eref& e, vector< Id >& tree )
584  const
585 {
586  unsigned int ret = 1;
587  Eref er( e.element(), ALLDATA );
588  vector< Id > kids = getChildren( er );
589  sort( kids.begin(), kids.end() );
590  kids.erase( unique( kids.begin(), kids.end() ), kids.end() );
591  for ( vector< Id >::iterator i = kids.begin(); i != kids.end(); ++i )
592  ret += buildTree( i->eref(), tree );
593  tree.push_back( e.element()->id() );
594  return ret;
595 }
597 // Dest Functions
599 
600 //
601 // Stage 0: Check if it is a Msg. This is deleted by Msg::deleteMsg( ObjId )
602 // Stage 1: mark for deletion. This is done by setting cinfo = 0
603 // Stage 2: Clear out outside-going msgs
604 // Stage 3: delete self and attached msgs,
605 void Neutral::destroy( const Eref& e, int stage )
606 {
607  if ( e.element()->cinfo()->isA( "Msg" ) ) {
608  Msg::deleteMsg( e.objId() );
609  return;
610  }
611  vector< Id > tree;
612  Eref er( e.element(), ALLDATA );
613  unsigned int numDescendants = buildTree( er, tree );
614  /*
615  cout << "Neutral::destroy: id = " << e.id() <<
616  ", name = " << e.element()->getName() <<
617  ", numDescendants = " << numDescendants << endl;
618  */
619  assert( numDescendants == tree.size() );
621 }
622 
628  unsigned int, unsigned int, unsigned int )
629 {
630 }
631 
637  unsigned int myNode, vector< unsigned int > nodeAssignment )
638 {
639 }
640 
641 
643 // Static utility functions.
645 
646 // static function
647 bool Neutral::isDescendant( Id me, Id ancestor )
648 {
649  static const Finfo* pf = neutralCinfo->findFinfo( "parentMsg" );
650  static const DestFinfo* pf2 = dynamic_cast< const DestFinfo* >( pf );
651  static const FuncId pafid = pf2->getFid();
652 
653  Eref e = me.eref();
654 
655  while ( e.element()->id() != Id() && e.element()->id() != ancestor ) {
656  ObjId mid = e.element()->findCaller( pafid );
657  assert( mid != ObjId() );
658  ObjId fid = Msg::getMsg( mid )->findOtherEnd( e.objId() );
659  e = fid.eref();
660  }
661  return ( e.element()->id() == ancestor );
662 }
663 
664 // static function
665 Id Neutral::child( const Eref& e, const string& name )
666 {
667  static const Finfo* pf = neutralCinfo->findFinfo( "parentMsg" );
668  static const DestFinfo* pf2 = dynamic_cast< const DestFinfo* >( pf );
669  static const FuncId pafid = pf2->getFid();
670  static const Finfo* cf = neutralCinfo->findFinfo( "childOut" );
671  static const SrcFinfo* cf2 = dynamic_cast< const SrcFinfo* >( cf );
672  static const BindIndex bi = cf2->getBindIndex();
673 
674  const vector< MsgFuncBinding >* bvec = e.element()->getMsgAndFunc( bi );
675 
676  vector< Id > ret;
677 
678  for ( vector< MsgFuncBinding >::const_iterator i = bvec->begin();
679  i != bvec->end(); ++i ) {
680  if ( i->fid == pafid ) {
681  const Msg* m = Msg::getMsg( i->mid );
682  assert( m );
683  Element* e2 = m->e2();
684  if ( e2->getName() == name ) {
685  if ( e.dataIndex() == ALLDATA ) {// Child of any index is OK
686  return e2->id();
687  } else {
688  ObjId parent = m->findOtherEnd( m->getE2() );
689  // If child is a fieldElement, then all parent indices
690  // are permitted. Otherwise insist parent dataIndex OK.
691  if ( e2->hasFields() || parent == e.objId() )
692  return e2->id();
693  }
694  }
695  }
696  }
697  return Id();
698 }
699 
700 // Static function.
702 {
703  return Neutral::parent( e.objId() );
704 }
705 
707 {
708  static const Finfo* pf = neutralCinfo->findFinfo( "parentMsg" );
709  static const DestFinfo* pf2 = dynamic_cast< const DestFinfo* >( pf );
710  static const FuncId pafid = pf2->getFid();
711 
712  if ( oid.id == Id() ) {
713  cout << "Warning: Neutral::parent: tried to take parent of root\n";
714  return Id();
715  }
716 
717  ObjId mid = oid.element()->findCaller( pafid );
718  assert( mid != ObjId() );
719 
720  ObjId pa = Msg::getMsg( mid )->findOtherEnd( oid );
721  return pa;
722 }
723 
724 // Static function
725 string Neutral::path( const Eref& e )
726 {
727  static const Finfo* pf = neutralCinfo->findFinfo( "parentMsg" );
728  static const DestFinfo* pf2 = dynamic_cast< const DestFinfo* >( pf );
729  static const FuncId pafid = pf2->getFid();
730 
731  vector< ObjId > pathVec;
732  ObjId curr = e.objId();
733  stringstream ss;
734 
735  pathVec.push_back( curr );
736  while ( curr.id != Id() ) {
737  ObjId mid = curr.eref().element()->findCaller( pafid );
738  if ( mid == ObjId() ) {
739  cout << "Error: Neutral::path:Cannot follow msg of ObjId: " <<
740  e.objId() << " for func: " << pafid << endl;
741  break;
742  }
743  curr = Msg::getMsg( mid )->findOtherEnd( curr );
744  pathVec.push_back( curr );
745  }
746  if ( pathVec.size() <= 1 )
747  return "/";
748  for ( unsigned int i = 1; i < pathVec.size(); ++i ) {
749  ss << "/";
750  ObjId& oid = pathVec[ pathVec.size() - i - 1 ];
751  ss << oid.element()->getName();
752  if ( !oid.element()->hasFields() )
753  ss << "[" << oid.dataIndex << "]";
754  /*
755  if ( !oid.element()->hasFields() )
756  ss << "[" << oid.dataIndex << "]";
757  if ( oid.element()->numData() > 1 )
758  ss << "[" << oid.dataIndex << "]";
759  */
760  }
761  // Append braces if Eref was for a fieldElement. This should
762  // work even if it is off-node.
763  if ( e.element()->hasFields() ) {
764  ss << "[" << e.fieldIndex() << "]";
765  }
766 
767  return ss.str();
768 }
769 
770 // Neutral does not have any fields.
771 istream& operator >>( istream& s, Neutral& d )
772 {
773  return s;
774 }
775 
776 ostream& operator <<( ostream& s, const Neutral& d )
777 {
778  return s;
779 }
780 
781 bool Neutral::isGlobalField( const string& field )
782 {
783  if ( field.length() < 8 )
784  return 0;
785  if ( field.substr( 0, 4 ) == "set_" ) {
786  if ( field == "set_name" )
787  return 1;
788  if ( field == "set_group" )
789  return 1;
790  if ( field == "set_lastDimension" ) // This is the critical one!
791  return 1;
792  }
793  return 0;
794 }
795 
bool isA(const Eref &e, string className) const
Definition: Neutral.cpp:576
Neutral()
Definition: Neutral.cpp:273
Id id() const
Definition: Eref.cpp:62
virtual ObjId findOtherEnd(ObjId) const =0
const vector< ObjId > & msgIn() const
Definition: Element.cpp:387
Element * e2() const
Definition: Msg.h:68
ObjId mid() const
Definition: Msg.h:106
bool isDataHere() const
Definition: Eref.cpp:47
unsigned int getNumField(const Eref &e) const
Definition: Neutral.cpp:408
static ObjId parent(const Eref &e)
Definition: Neutral.cpp:701
Finfo * getDestFinfo(unsigned int i) const
Definition: Cinfo.cpp:430
Finfo * getValueFinfo(unsigned int i) const
Definition: Cinfo.cpp:453
unsigned int getNumSrcFinfo() const
Definition: Cinfo.cpp:421
ObjId getParent(const Eref &e) const
Definition: Neutral.cpp:326
vector< ObjId > getMsgDests(const Eref &e, string src) const
Definition: Neutral.cpp:538
void setName(const string &val)
Definition: Element.cpp:61
static A get(const ObjId &dest, const string &field, L index)
Definition: SetGet.h:532
unsigned int getFieldIndex(const Eref &e) const
fieldIndex specifies field entry if FieldElement. Otherwise zero
Definition: Neutral.cpp:432
unsigned short BindIndex
Definition: header.h:62
unsigned int getNumDestFinfo() const
Definition: Cinfo.cpp:444
BindIndex getBindIndex() const
Definition: SrcFinfo.cpp:28
ObjId getObjId(const Eref &e) const
Definition: Neutral.cpp:321
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
unsigned int value() const
Definition: Id.cpp:197
string getPath(const Eref &e) const
Definition: Neutral.cpp:388
Definition: Dinfo.h:60
void setTick(const Eref &e, int num)
Definition: Neutral.cpp:442
Definition: EpFunc.h:64
Id id
Definition: ObjId.h:98
unsigned int dataIndex() const
Definition: Eref.h:50
unsigned int getMsgTargetAndFunctions(DataId srcDataId, const SrcFinfo *finfo, vector< ObjId > &tgt, vector< string > &func) const
Definition: Element.cpp:772
unsigned int getNumValueFinfo() const
Definition: Cinfo.cpp:467
static bool isGlobalField(const string &field)
Definition: Neutral.cpp:781
void setNumData(const Eref &e, unsigned int num)
Definition: Neutral.cpp:403
double getDt(const Eref &e) const
Returns dt associated with this object based on its clock tick.
Definition: Neutral.cpp:447
vector< string > getDestFields(const Eref &e) const
Information function to return names of all DestFinfos.
Definition: Neutral.cpp:481
static Id child(const Eref &e, const string &name)
Definition: Neutral.cpp:665
istream & operator>>(istream &s, Neutral &d)
Definition: Neutral.cpp:771
static const Cinfo * neutralCinfo
Definition: Neutral.cpp:270
Definition: ObjId.h:20
vector< string > getMsgDestFunctions(const Eref &e, string src) const
Definition: Neutral.cpp:557
Eref eref() const
Definition: Id.cpp:125
static void children(const Eref &e, vector< Id > &ret)
Definition: Neutral.cpp:342
const string & name() const
Definition: Finfo.cpp:80
Element * element() const
Definition: Eref.h:42
unsigned int buildTree(const Eref &e, vector< Id > &tree) const
Definition: Neutral.cpp:583
vector< Id > getNeighbors(const Eref &e, string field) const
Definition: Neutral.cpp:525
unsigned int fieldIndex() const
Definition: Eref.h:61
virtual void targets(vector< vector< Eref > > &v) const =0
vector< string > getValueFields(const Eref &e) const
Information function to return names of all value Finfos.
Definition: Neutral.cpp:457
static string path(const Eref &e)
Definition: Neutral.cpp:725
Definition: EpFunc.h:95
vector< ObjId > getOutgoingMsgs(const Eref &e) const
Definition: Neutral.cpp:493
Id id() const
Definition: Element.cpp:71
unsigned int getIndex(const Eref &e) const
Index is the dataIndex of the object.
Definition: Neutral.cpp:427
int getTick() const
Definition: Element.cpp:186
ostream & operator<<(ostream &s, const Neutral &d)
Definition: Neutral.cpp:776
const unsigned int ALLDATA
Used by ObjId and Eref.
Definition: consts.cpp:22
vector< Id > getChildren(const Eref &e) const
Definition: Neutral.cpp:334
vector< ObjId > getIncomingMsgs(const Eref &e) const
Definition: Neutral.cpp:511
const std::string & name() const
Definition: Cinfo.cpp:260
unsigned int getId(const Eref &e) const
Id is the Id of the object, converted to unsigned int.
Definition: Neutral.cpp:422
static unsigned int myNode
static bool isDescendant(Id me, Id ancestor)
Definition: Neutral.cpp:647
static void deleteMsg(ObjId mid)
Definition: Msg.cpp:52
ObjId findCaller(FuncId fid) const
Definition: Element.cpp:350
unsigned int getNumData(const Eref &e) const
Definition: Neutral.cpp:398
virtual unsigned int numField(unsigned int rawIndex) const =0
Returns number of field entries for specified data.
FuncId getFid() const
Definition: DestFinfo.cpp:45
void setName(const Eref &e, string name)
Definition: Neutral.cpp:294
Id getE2() const
Definition: Msg.cpp:75
void blockNodeBalance(const Eref &e, unsigned int, unsigned int, unsigned int)
Definition: Neutral.cpp:627
virtual bool hasFields() const =0
vector< string > getSourceFields(const Eref &e) const
Information function to return names of all SrcFinfos.
Definition: Neutral.cpp:469
ObjId objId() const
Definition: Eref.cpp:57
Definition: Eref.h:26
bool isA(const string &ancestor) const
Definition: Cinfo.cpp:280
Finfo * getSrcFinfo(unsigned int i) const
Definition: Cinfo.cpp:406
const vector< MsgFuncBinding > * getMsgAndFunc(BindIndex b) const
Definition: Element.cpp:300
const Cinfo * cinfo() const
Definition: Element.cpp:66
string getClass(const Eref &e) const
Definition: Neutral.cpp:393
virtual unsigned int numData() const =0
Returns number of data entries across all nodes.
Definition: Msg.h:18
void generalNodeBalance(const Eref &e, unsigned int myNode, vector< unsigned int > nodeAssignment)
Definition: Neutral.cpp:636
Element * element() const
Definition: ObjId.cpp:124
void destroy(const Eref &e, int stage)
Definition: Neutral.cpp:605
static char name[]
Definition: mfield.cpp:401
static void destroyElementTree(const vector< Id > &tree)
Definition: Element.cpp:676
Eref eref() const
Definition: ObjId.cpp:66
int getTick(const Eref &e) const
Returns clock tick of this object.
Definition: Neutral.cpp:437
void setThis(Neutral v)
Definition: Neutral.cpp:284
Definition: Id.h:17
void setTick(int t)
Definition: Element.cpp:251
unsigned int getNeighbors(vector< Id > &ret, const Finfo *finfo) const
Definition: Element.cpp:949
virtual unsigned int rawIndex(unsigned int dataIndex) const =0
static const Msg * getMsg(ObjId m)
Definition: Msg.cpp:59
unsigned int numBindIndex() const
Definition: Cinfo.cpp:265
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
string getName(const Eref &e) const
Definition: Neutral.cpp:316
Neutral getThis() const
Definition: Neutral.cpp:289
static char id[]
Definition: mfield.cpp:404
unsigned int FuncId
Definition: header.h:42
const string & getName() const
Definition: Element.cpp:56
virtual void resizeField(unsigned int rawIndex, unsigned int newNumField)=0
void setNumField(const Eref &e, unsigned int num)
Definition: Neutral.cpp:415
Definition: Cinfo.h:18
virtual void resize(unsigned int newNumData)=0
Definition: EpFunc.h:79
static bool isNameValid(const string &name)
Definition: Shell.cpp:499
const Finfo * findFinfo(const string &name) const
Definition: Cinfo.cpp:224
unsigned int dataIndex
Definition: ObjId.h:99
Definition: Finfo.h:12