Algorithms::Frm Class Reference

First reaction method algorithm. More...

List of all members.

Classes

struct  Sort_event_by_time
 Functor to sort the events in the queue.

Public Types

typedef std::map
< Reactions::Reaction::Name,
int > 
ReactionCounter
 Define counter of reactions.

Public Member Functions

 Frm (Surface::Lattice::iterator first, Surface::Lattice::iterator last)
 Constructor.
void Init ()
 Create and sort the event list.
void operator() ()
 Perform fastest event.
void Clear ()
 Clear all events.
Accessors
double time () const
 Return the simulation time.
ReactionCounter reaction_counter ()
 Return the reaction counter.
Modifiers
void set_time (double time)
 Set time in the simulation.
void set_reaction_ptr (Reactions::Reaction *reaction)
 Add a reaction the reaction container.


Detailed Description

Usage:
Implemented as a functor
 Surface::Lattice lattice(128);
 // ... define lattice ...
 Frm frm(lattice.begin(), lattice.end());
 // ... create reactions Diffusion, Adsorption, etc.
 frm.AddReactionPtr(co_diffusion);
 frm.Init();
 frm(); // perform one Monte-Carlo step
 frm(); // etc.
Author:
Mathias Laurin <mathias_laurin@users.sourceforge.net>
Date:
2008-10-30
Todo:
Use better container: change typedef std::multimap<Surface::Site*, Reactions::EventPtr> EventsPerSiteContainer; to typedef ml_container::associative_vector<Surface::Site*, std::vector<Reactions::EventPtr> > EventsPerSiteContainer;

Constructor & Destructor Documentation

Algorithms::Frm::Frm ( Surface::Lattice::iterator  first,
Surface::Lattice::iterator  last 
) [inline]

Parameters:
[in] first iterator to the first element of the lattice
[in] last iterator to the last element of the lattice


Member Function Documentation

ReactionCounter Algorithms::Frm::reaction_counter (  )  [inline]

Returns:
ReactionCounter

void Algorithms::Frm::set_reaction_ptr ( Reactions::Reaction reaction  )  [inline]

Parameters:
[in] &reaction 

void Algorithms::Frm::set_time ( double  time  )  [inline]

Parameters:
[in] time 

double Algorithms::Frm::time (  )  const [inline]

Returns:
time


The documentation for this class was generated from the following file:

SourceForge.net Logo Project's page
Generated on Mon Nov 17 00:23:05 2008 for dmcut2 by doxygen 1.5.7