~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to demo/ode/stiff/TestProblem1.h

  • Committer: Johannes Ring
  • Date: 2008-03-05 22:43:06 UTC
  • Revision ID: johannr@simula.no-20080305224306-2npsdyhfdpl2esji
The BIG commit!

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 <dolfin.h>
 
8
 
 
9
using namespace dolfin;
 
10
 
 
11
class TestProblem1 : public ODE
 
12
{
 
13
public:
 
14
  
 
15
  TestProblem1() : ODE(1, 10.0)
 
16
  {
 
17
    message("The simple test equation: u' = -1000 u, u(0) = 1.");
 
18
  }
 
19
 
 
20
  void u0(uBlasVector& u)
 
21
  {
 
22
    u(0) = 1.0;
 
23
  }
 
24
  
 
25
  void f(const uBlasVector& u, real t, uBlasVector& y)
 
26
  {
 
27
    y(0) = -1000.0 * u(0);
 
28
  }
 
29
  
 
30
};