API for Python interface.

1. Key data structures, not accessed directly, but important for concepts:
	- Element: Managers for objects. This includes data, messaging, 
	field info and class info. All Elements can be arrays.
	- Finfo: Field information specifiers, used to build up the MOOSE
	interface to the underlying C++ class. Similar to the old MOOSE.
		Major Subclasses:
		- DestFinfo: used for functions of the Object. Can be called
			either using SetGet::set or by messages.
		- SrcFinfo: Used to call messages.
		- ValueFinfo: Used to define fields. The ReadOnly kind has
			just the 'get' function, whereas the normal kind
			also has a 'set' function. Both 'get' and 'set' are
			implemented as DestFinfos.
	- Cinfo: Class information specifier, used to specify class name,
	inheritance, and manage the array of Finfos.
	- Msg: Messages. Many subclasses. Handle communication between Elements.
	All Msgs are between precisely two Elements. So the Elements are nodes
	and the Msgs are edges. Msg have a lot of variety in how they control
	data transfer between individual array entries within the source and
	destination Element. Data transfer can be bidirectional.
	All Msgs provide a handle to an Element called a MsgManager, which
	allows you to inspect the Msg fields and in some cases modify them.
	But you cannot modify the source and destination Elements.

2. Key data structures that you will access.

Id: Handle to Elements.
DataId: Handle to objects on Elements. Has a data part and a field part.
	The data part is the parent object, and is used for any array Element.
	The field part is for array fields within individual data entries, 
	in cases where the array fields themselves are accessed like Elements.
	For example, in an IntFire neuron, you could have an
	array of a million IntFire neurons on Element A, and each IntFire
	neuron might have a random individual number, say, 10000, 15000, 8000,
	etc Synapses. To index Synapse 234 on IntFire 999999 you would use a
	DataId( 999999, 234).

ObjId: Composite of Id and DataId. Allows you to uniquely identify any entity
	in the simulation.


3. Field assignments and function calls:
	File: SetGet.h
		This has a series of templates for different argument cases.
		1. If you want to call a function foo( int A, double B ) on
		ObjId oid, you would do:

		SetGet2< int, double >::set( oid, "foo", A, B );

		2. To call a function bar( int A, double B, string C ) on oid:
		SetGet3< int, double, string >::set( oid, "bar", A, B, C );

		3. To assign a field value  "short abc" on object oid:
		Field< short >::set( oid, "abc", 123 );

		4. To get a field value "double pqr" on object obj:
		double x = Field< short >::get( oid, "pqr" );

		5. To assign the double 'xcoord' field on all the objects on 
			element Id id, which has an array of the objects:
		vector< double > newXcoord;
		// Fill up the vector here.
		Field< double >::setVec( id, "xcoord", newXcoord );
		Note that the dimensions of newXcoord should match those of
		the target element.

		You can also use a similar call if it is just a function on id:
		SetGet1< double >::setVec( id, "xcoord_func", newXcoord );

		6. To extract the double vector 'ycoord' field from all the
			objects on id:
		vector< double > oldYcoord; // Do not need to allocate.
		Field< double >::getVec( id, "ycoord", oldYcoord );

		7. To set/get LookupFields, that is fields which have an index
			to lookup:
		double x = LookupField< unsigned int, double >::get( objId, field, index );
		LookupField< unsigned int, double >::set( objId, field, index, value );

	There are lots of other variants here.

4. Shell commands to use: the ones that start with 'do'.

Id doCreate(  string type, Id parent, string name, 
	vector< unsigned int > dimensions );

bool doDelete( Id id )

MsgId doAddMsg( const string& msgType, 
	ObjId src, const string& srcField, 
	ObjId dest, const string& destField);

void doQuit();

void doStart( double runtime );

void doNonBlockingStart( double runtime );

void doReinit();

void doStop();

void doTerminate();

void doMove( Id orig, Id newParent );

Id doCopyId orig, Id newParent, string newName,
	unsigned int n, bool copyExtMsgs);

Id doFind( const string& path ) const

void doSetClock( unsigned int tickNum, double dt )

void doUseClock( string path, string field, unsigned int tick );

Id doLoadModel( const string& fname, const string& modelpath );

void doSyncDataHandler( Id elm, const string& sizeField, Id tgt );


5. Important fields of important objects.

5.1. Shell object. This is the root object, '/' or '/root'.
This has the following fields of note:
	- bool isRunning: ReadOnlyValue
	- Id cwe: Regular value. 

5.2 Neutral. These fields are shared by all objects.
	string name
	ObjId parent			// Parent ObjId. Note this is fully
					// specified, including index.
	vector< Id > children		// All child elements.
	string path			// Full path
	string className		
	unsigned int linearSize		// Product of all dimensions
					// Currently not working.
	vector< unsigned int> Dimensions
	unsigned int fieldDimension	// Size of field dimension.
	vector< ObjId > msgOut 		// MsgManagers of all outgoing msgs
	vector< ObjId > msgIn		// MsgManagers of all incoming msgs
	vector< Id > msgSrc( string field )	// Ids of source msgs into field
	vector< Id > msgDest( string field )	// Ids of dest msgs into field

5.3 Class Info objects. These are located in /classes/<classname>
	string docs			// currently not implemented
	string baseClass		// Name of base class

5.4 Field Info objects. These are children of the respective ClassInfo and
	are located in /classes/<classname>/<Field category>
	There are 5 field categories:
	srcFinfo
	destFinfo
	valueFinfo
	lookupFinfo
	sharedFinfo
	Each of these is an array, indexed as DataId( 0, <index> )
	since they are FieldElements.
	You can query the # of entries in each category using
		Id classId( "/classes/<classname>" );
		numValueFinfos = 
			Field< unsigned int >::get( classId, "num_valueFinfo" );
	
	Finally each of the field categories has the following fields:
	string name
	string docs		// This is implemented
	string type		// String with argument types separated by
				// commas. Can handle basic types, Ids,
				// ObjIds, DataIds, strings, and vectors of
				// any of the above.
	vector< string > src	// vector of subsidiary srcFinfos, which 
				// happens in SharedFinfos.
	vector< string > dest	// vector of subsidiary destFinfos, which 
				// happens in SharedFinfos and ValueFinfos.



6. Message traversal, C++ level:
General approach: 
	- If you just want src/dest Id, use the Neutral or Element functions
		to find list of source or target Ids as per spec.
		- Netural::msgSrc( string field );
		- Netural::msgDest( string field );
		- Element::getOutputs( vector< Id >& ret, const SrcFinfo* finfo)
		- Element::getInputs( vector< Id >& ret, const DestFinfo* finfo)

	- If you want to iterate through specific array and/or field
		entries in src/dest Id, then you will have to look up the
		MsgIds themselves.
		- vector< ObjId > Neutral::msgOut(): 
			Not very specific, just the ObjIds of the MsgManagers
			of all outgoing Msgs.
		- vector< ObjId > Neutral::msgIn(): 
			All ObjIds of MsgManagers of incoming Msgs.
		- MsgId Element::findCaller( FuncId fid ) const: 
			Looks up the first Msg that calls the specified Fid 
		- Element::getInputMsgs( vector< MsgId >& caller, FuncId fid)
			Fills up vector of MsgIds that call the specified fid 

	- To convert between MsgIds, Msgs, and the manager ObjId:
		- MsgId Msg::mid(): 	returns the MsgId of the Msg.
		- Msg::manager():	 returns the manager Eref of a Msg.
		- Msg::manager().objId(): returns the manager ObjId of a Msg.
		- static const Msg* Msg::getMsg( MsgId mid )
					Returns the Msg ptr given a MsgId.

	- To iterate through Msg targets:
		unsigned int Msg::srcToDestPairs(
			vector< DataId >& src, vector< DataId >& dest) const
			This function gives matching vectors of src and dest
			pairs for the Msg. This should be node-independent,
			but the SparseMsg currently doesn't handle it right,
			and works only on 1 node.

