Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

TestProblem6.h

Go to the documentation of this file.
00001 // Copyright (C) 2004 Johan Hoffman and Anders Logg.
00002 // Licensed under the GNU GPL Version 2.
00003 
00004 #include <cmath>
00005 #include <dolfin.h>
00006 
00007 using namespace dolfin;
00008 
00009 class TestProblem6 : public ODE
00010 {
00011 public:
00012   
00013   TestProblem6() : ODE(2)
00014   {
00015     dolfin_info("Van der Pol's equation.");
00016 
00017     // Final time
00018     T = 100.0;
00019 
00020     // Parameters
00021     mu = 10.0;
00022 
00023     // Compute sparsity
00024     sparse();
00025   }
00026 
00027   real u0(unsigned int i)
00028   {
00029     switch (i) {
00030     case 0:
00031       return 2.0;
00032     default:
00033       return 0.0;
00034     }
00035   }
00036 
00037   real f(const Vector& u, real t, unsigned int i)
00038   {
00039     switch (i) {
00040     case 0:
00041       return u(1);
00042     default:
00043       return mu*(1.0-u(0)*u(0))*u(1) - u(0);
00044     }
00045   }
00046 
00047 private:
00048 
00049   real mu;
00050 
00051 };


Documentation automatically generated with Doxygen on 10 Sep 2004.