MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Shell.cpp File Reference
#include <string>
#include <algorithm>
#include "header.h"
#include "global.h"
#include "SingleMsg.h"
#include "DiagonalMsg.h"
#include "OneToOneMsg.h"
#include "OneToAllMsg.h"
#include "SparseMatrix.h"
#include "SparseMsg.h"
#include "Shell.h"
#include "Dinfo.h"
#include "Wildcard.h"
#include "../scheduling/Clock.h"
+ Include dependency graph for Shell.cpp:

Go to the source code of this file.

Functions

bool extractIndex (const string &s, unsigned int &index)
 
void insertSharedMsgs (const Finfo *f, const Element *e, vector< ObjId > &msgs)
 
bool isDoingReinit ()
 

Variables

static const CinfoshellCinfo = Shell::initCinfo()
 

Function Documentation

bool extractIndex ( const string &  s,
unsigned int &  index 
)

Definition at line 423 of file Shell.cpp.

Referenced by Shell::chopPath(), and testExtractIndices().

424 {
425  vector< unsigned int > open;
426  vector< unsigned int > close;
427 
428  index = 0;
429  if ( s.length() == 0 ) // a plain slash is OK
430  return true;
431 
432  if ( s[0] == '[' ) // Cannot open with a brace
433  return false;
434 
435  for ( unsigned int i = 0; i < s.length(); ++i )
436  {
437  if ( s[i] == '[' )
438  open.push_back( i+1 );
439  else if ( s[i] == ']' )
440  close.push_back( i );
441  }
442 
443  if ( open.size() != close.size() )
444  return false;
445  if ( open.size() == 0 )
446  return true; // the index was set already to zero.
447  int j = atoi( s.c_str() + open[0] );
448  if ( j >= 0 )
449  {
450  index = j;
451  return true;
452  }
453  return false;
454 }

+ Here is the caller graph for this function:

void insertSharedMsgs ( const Finfo f,
const Element e,
vector< ObjId > &  msgs 
)

Definition at line 863 of file Shell.cpp.

References SharedFinfo::dest(), DestFinfo::getFid(), and Element::getInputMsgs().

Referenced by Shell::dropClockMsgs().

865 {
866  const SharedFinfo* sf = dynamic_cast< const SharedFinfo *>( f );
867  if ( sf )
868  {
869  for ( vector< Finfo* >::const_iterator j =
870  sf->dest().begin(); j != sf->dest().end(); ++j )
871  {
872  DestFinfo* df = dynamic_cast< DestFinfo* >( *j );
873  assert( df );
874  FuncId fid = df->getFid();
875  // These are the messages to be zapped
876  vector< ObjId > caller;
877  if ( e->getInputMsgs( caller, fid ) > 0 )
878  {
879  msgs.insert( msgs.end(), caller.begin(), caller.end() );
880  }
881  }
882  }
883 }
const vector< Finfo * > & dest() const
FuncId getFid() const
Definition: DestFinfo.cpp:45
unsigned int getInputMsgs(vector< ObjId > &caller, FuncId fid) const
Definition: Element.cpp:984
unsigned int FuncId
Definition: header.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool isDoingReinit ( )

Definition at line 353 of file Shell.cpp.

References Eref::data(), Id::element(), and Id::eref().

354 {
355  static Id clockId( 1 );
356  assert( clockId.element() != 0 );
357 
358  return ( reinterpret_cast< const Clock* >(
359  clockId.eref().data() ) )->isDoingReinit();
360 }
Definition: Id.h:17

+ Here is the call graph for this function:

Variable Documentation

const Cinfo* shellCinfo = Shell::initCinfo()
static

Definition at line 149 of file Shell.cpp.

Referenced by Shell::initCinfo().