MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FieldElementFinfo.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-2010 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 "../shell/Shell.h"
12 #include "../msg/OneToOneDataIndexMsg.h"
13 
15  Id parent, Element* parentElm ) const
16 {
17  static const Finfo* pf = Neutral::initCinfo()->findFinfo( "parentMsg" );
18  static const Finfo* f1 = Neutral::initCinfo()->findFinfo( "childOut" );
19 
20  if ( deferCreate_ )
21  return;
22  Id kid = Id::nextId();
23  Element* e = new FieldElement( parent, kid, fieldCinfo_, name(), this );
24  Msg* m = new OneToOneDataIndexMsg( parent.eref(), Eref( e, 0 ), 0 );
25  assert( m );
26  if ( !f1->addMsg( pf, m->mid(), parent.element() ) ) {
27  cout << "FieldElementFinfoBase::postCreationFunc: Error: \n" <<
28  " unable to add parent->child msg from " <<
29  parent.element()->getName() << " to " << name() << "\n";
30  return;
31  }
32 }
ObjId mid() const
Definition: Msg.h:106
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
Eref eref() const
Definition: Id.cpp:125
const string & name() const
Definition: Finfo.cpp:80
static Id nextId()
Definition: Id.cpp:132
virtual bool addMsg(const Finfo *target, ObjId mid, Element *src) const
Definition: Finfo.h:92
Definition: Eref.h:26
Definition: Msg.h:18
void postCreationFunc(Id parent, Element *parentElm) const
Definition: Id.h:17
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
const string & getName() const
Definition: Element.cpp:56
const Finfo * findFinfo(const string &name) const
Definition: Cinfo.cpp:224
Definition: Finfo.h:12