~ubuntu-branches/ubuntu/maverick/dolfin/maverick

« back to all changes in this revision

Viewing changes to demo/ode/stiff/cpp/TestProblem6.h

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2008-09-16 08:41:20 UTC
  • Revision ID: james.westby@ubuntu.com-20080916084120-i8k3u6lhx3mw3py3
Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2004-2006 Anders Logg.
 
2
// Licensed under the GNU LGPL Version 2.1.
 
3
//
 
4
// First added:  2004
 
5
// Last changed: 2006-08-21
 
6
 
 
7
#include <cmath>
 
8
#include <dolfin.h>
 
9
 
 
10
using namespace dolfin;
 
11
 
 
12
class TestProblem6 : public ODE
 
13
{
 
14
public:
 
15
  
 
16
  TestProblem6() : ODE(2, 100.0)
 
17
  {
 
18
    message("Van der Pol's equation.");
 
19
 
 
20
    mu = 10.0;
 
21
  }
 
22
 
 
23
  void u0(double* u)
 
24
  {
 
25
    u[0] = 2.0;
 
26
    u[1] = 0.0;
 
27
  }
 
28
 
 
29
  void f(const double* u, double t, double* y)
 
30
  {
 
31
    y[0] = u[1];
 
32
    y[1] = mu*(1.0 - u[0]*u[0])*u[1] - u[0];
 
33
  }
 
34
 
 
35
private:
 
36
 
 
37
  double mu;
 
38
 
 
39
};