MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Neutral.h
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 #ifndef _NEUTRAL_H
11 #define _NEUTRAL_H
12 
13 
14 #ifdef CYMOOSE
15 
16 #include "../basecode/ProcInfo.h"
17 
18 class Cinfo;
19 
20 #endif /* ----- CYMOOSE ----- */
21 
22 class Neutral
23 {
24  public:
25  friend istream& operator >>( istream& s, Neutral& d );
26  friend ostream& operator <<( ostream& s, const Neutral& d );
27  Neutral();
28 
30  // Field access functions
32 
41  void setThis( Neutral v );
42 
51  Neutral getThis() const;
52 
56  void setName( const Eref& e, string name );
57  string getName( const Eref& e ) const;
58 
62  vector< ObjId > getOutgoingMsgs( const Eref& e ) const;
63 
67  vector< ObjId > getIncomingMsgs( const Eref& e ) const;
68 
75  vector< Id > getNeighbors( const Eref& e, string field ) const;
76 
82  vector< ObjId > getMsgDests( const Eref& e, string src ) const;
83 
89  vector< string > getMsgDestFunctions(
90  const Eref& e, string src ) const;
91 
95  bool isA( const Eref& e, string className ) const;
96 
100  ObjId getObjId( const Eref& e ) const;
101 
105  ObjId getParent( const Eref& e ) const;
106 
110  vector< Id > getChildren( const Eref& e ) const;
111 
115  unsigned int buildTree( const Eref& e, vector< Id >& tree ) const;
116 
120  string getPath( const Eref& e ) const;
121 
125  string getClass( const Eref& e ) const;
126 
130  void setNumData( const Eref& e, unsigned int num );
131  unsigned int getNumData( const Eref& e ) const;
132 
137  void setNumField( const Eref& e, unsigned int num );
138  unsigned int getNumField( const Eref& e ) const;
139 
141  unsigned int getId( const Eref& e ) const;
143  unsigned int getIndex( const Eref& e ) const;
145  unsigned int getFieldIndex( const Eref& e ) const;
146 
154  void setTick( const Eref& e, int num );
156  int getTick( const Eref& e ) const;
157 
159  double getDt( const Eref& e ) const;
160 
162  vector< string > getValueFields( const Eref& e ) const;
164  vector< string > getSourceFields( const Eref& e ) const;
166  vector< string > getDestFields( const Eref& e ) const;
168  // DestFinfo functions
170 
174  void destroy( const Eref& e, int stage );
175 
180  void blockNodeBalance( const Eref& e,
181  unsigned int, unsigned int, unsigned int );
182 
187  void generalNodeBalance( const Eref& e,
188  unsigned int myNode, vector< unsigned int > nodeAssignment );
189 
190 
192  // Static utility functions
194 
198  static Id child( const Eref& e, const string& name );
199 
203  static ObjId parent( const Eref& e );
204  static ObjId parent( ObjId id );
205 
209  static bool isDescendant( Id me, Id ancestor );
210 
215  static const Cinfo* initCinfo();
216 
220  static void children( const Eref& e, vector< Id >& ret );
221 
225  static string path( const Eref& e );
226 
232  static bool isGlobalField( const string& field );
233 
234  private:
235  // string name_;
236 };
237 
238 #endif // _NEUTRAL_H
bool isA(const Eref &e, string className) const
Definition: Neutral.cpp:576
Neutral()
Definition: Neutral.cpp:273
unsigned int getNumField(const Eref &e) const
Definition: Neutral.cpp:408
static ObjId parent(const Eref &e)
Definition: Neutral.cpp:701
ObjId getParent(const Eref &e) const
Definition: Neutral.cpp:326
vector< ObjId > getMsgDests(const Eref &e, string src) const
Definition: Neutral.cpp:538
unsigned int getFieldIndex(const Eref &e) const
fieldIndex specifies field entry if FieldElement. Otherwise zero
Definition: Neutral.cpp:432
ObjId getObjId(const Eref &e) const
Definition: Neutral.cpp:321
string getPath(const Eref &e) const
Definition: Neutral.cpp:388
void setTick(const Eref &e, int num)
Definition: Neutral.cpp:442
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
Definition: ObjId.h:20
vector< string > getMsgDestFunctions(const Eref &e, string src) const
Definition: Neutral.cpp:557
static void children(const Eref &e, vector< Id > &ret)
Definition: Neutral.cpp:342
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
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
vector< ObjId > getOutgoingMsgs(const Eref &e) const
Definition: Neutral.cpp:493
unsigned int getIndex(const Eref &e) const
Index is the dataIndex of the object.
Definition: Neutral.cpp:427
vector< Id > getChildren(const Eref &e) const
Definition: Neutral.cpp:334
vector< ObjId > getIncomingMsgs(const Eref &e) const
Definition: Neutral.cpp:511
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
unsigned int getNumData(const Eref &e) const
Definition: Neutral.cpp:398
void setName(const Eref &e, string name)
Definition: Neutral.cpp:294
void blockNodeBalance(const Eref &e, unsigned int, unsigned int, unsigned int)
Definition: Neutral.cpp:627
vector< string > getSourceFields(const Eref &e) const
Information function to return names of all SrcFinfos.
Definition: Neutral.cpp:469
Definition: Eref.h:26
string getClass(const Eref &e) const
Definition: Neutral.cpp:393
void generalNodeBalance(const Eref &e, unsigned int myNode, vector< unsigned int > nodeAssignment)
Definition: Neutral.cpp:636
void destroy(const Eref &e, int stage)
Definition: Neutral.cpp:605
static char name[]
Definition: mfield.cpp:401
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
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
void setNumField(const Eref &e, unsigned int num)
Definition: Neutral.cpp:415
Definition: Cinfo.h:18
friend ostream & operator<<(ostream &s, const Neutral &d)
friend istream & operator>>(istream &s, Neutral &d)