~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/kernel/ode/dolfin/MonoAdaptiveJacobian.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) 2005-2006 Anders Logg.
2
 
// Licensed under the GNU LGPL Version 2.1.
3
 
//
4
 
// First added:  2005-01-28
5
 
// Last changed: 2006-07-06
6
 
 
7
 
#ifndef __MONO_ADAPTIVE_JACOBIAN_H
8
 
#define __MONO_ADAPTIVE_JACOBIAN_H
9
 
 
10
 
#include <dolfin/TimeSlabJacobian.h>
11
 
 
12
 
namespace dolfin
13
 
{
14
 
  
15
 
  class MonoAdaptiveTimeSlab;
16
 
    
17
 
  /// This class represents the Jacobian matrix of the system of
18
 
  /// equations defined on a mono-adaptive time slab.
19
 
 
20
 
  class MonoAdaptiveJacobian : public TimeSlabJacobian
21
 
  {
22
 
  public:
23
 
 
24
 
    /// Constructor
25
 
    MonoAdaptiveJacobian(MonoAdaptiveTimeSlab& timeslab,
26
 
                         bool implicit, bool piecewise);
27
 
 
28
 
    /// Destructor
29
 
    ~MonoAdaptiveJacobian();
30
 
 
31
 
    /// Return number of rows (dim = 0) or columns (dim = 1)
32
 
    uint size(uint dim) const;
33
 
 
34
 
    /// Compute product y = Ax
35
 
    void mult(const uBlasVector& x, uBlasVector& y) const;
36
 
 
37
 
    /// Update sparse copy of Jacobian
38
 
    void update();
39
 
 
40
 
    /// Update sparse copy of Jacobian
41
 
    void update(const uBlasVector& u, real t);
42
 
 
43
 
  private:
44
 
 
45
 
    /// Friends
46
 
    friend class MonoAdaptiveNewtonSolver;
47
 
 
48
 
    // The time slab
49
 
    MonoAdaptiveTimeSlab& ts;
50
 
 
51
 
    // True if ODE is implicit
52
 
    bool implicit;
53
 
 
54
 
    // True if M is piecewise constant
55
 
    bool piecewise;
56
 
 
57
 
    // FIXME: Maybe we can reuse some other vectors?
58
 
 
59
 
    // Temporary vectors for storing multiplication
60
 
    mutable uBlasVector xx;
61
 
    mutable uBlasVector yy;
62
 
 
63
 
  };
64
 
 
65
 
}
66
 
 
67
 
#endif