~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/demo/ode/stiff/TestProblem2.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 TestProblem2 : public ODE
12
 
{
13
 
public:
14
 
  
15
 
  TestProblem2() : ODE(2, 10.0), A(2, 2)
16
 
  {
17
 
    message("The simple test system.");
18
 
 
19
 
    A(0, 0) = -100.0;
20
 
    A(1, 1) = -1000.0;
21
 
  }
22
 
 
23
 
  void u0(uBlasVector& u)
24
 
  {
25
 
    u(0) = 1.0;
26
 
    u(1) = 1.0;
27
 
  }
28
 
  
29
 
  void f(const uBlasVector& u, real t, uBlasVector& y)
30
 
  {
31
 
    A.mult(u, y);
32
 
  }
33
 
 
34
 
private:
35
 
 
36
 
  uBlasDenseMatrix A;
37
 
  
38
 
};