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

« back to all changes in this revision

Viewing changes to demo/ode/stiff/cpp/TestProblem3.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) 2003-2008 Anders Logg.
 
2
// Licensed under the GNU LGPL Version 2.1.
 
3
//
 
4
// First added:  2003
 
5
// Last changed: 2008-10-07
 
6
 
 
7
#include <dolfin.h>
 
8
 
 
9
using namespace dolfin;
 
10
 
 
11
class TestProblem3 : public ODE
 
12
{
 
13
public:
 
14
  
 
15
  TestProblem3() : ODE(2, 1.0)
 
16
  {
 
17
    message("A non-normal test problem, critically damped oscillation.");
 
18
  }
 
19
 
 
20
  void u0(double* u)
 
21
  {
 
22
    u[0] = 1.0;
 
23
    u[1] = 1.0;
 
24
  }
 
25
 
 
26
  void f(const double* u, double t, double* y)
 
27
  {
 
28
    y[0] = -1000*u[0] + 10000*u[1];
 
29
    y[1] = -100*u[1];
 
30
  }
 
31
 
 
32
};