Subject: [Paracardium-dev] ODE issue

From: Ola Skavhaug <[email-masked]>
Date: Wed, 11 Feb 2009 10:26:45 +0100

Sorry for cross posting.

The new ODECollection class in DOLFIN will enable batch processing of ODEs,
and this is exactly what we need to solve the bidomain equations. However,
the interaction with the ODEs are limited. The callback method update(ODE&,
real*, uint) gives, in principle, the user an opportunity to interact with
each ODE system before stepping forward in time. However, the interface of
dolfin::ODE is too limited to really benefit from the callback. I suggest
another callback, now at the ODE level, that can be called from a possible
subclass of dolfin::ODECollection's update:

namespace paracardium
{
class CellCollection: public dolfin::ODECollection
{
  public:

      [...]

      virtual void update(ODE& ode, real* u, uint system)
      {
         ode.update(parameters[system]);
      }

   private:
      std::vector<real*> parameters; // parameters.size() == num_systems.

}; // End class

} // End namespace

Of course, we run the risk of the ode.update() call getting the wrong number
of array components. I would argue that the need for speed is important
enough to take this risk.

-- 
Ola Skavhaug