]> https://gitweb.dealii.org/ - dealii.git/commitdiff
ThetaTimestepping is running
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 7 Jul 2010 14:56:48 +0000 (14:56 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 7 Jul 2010 14:56:48 +0000 (14:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@21458 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/doxygen/product_matrix.cc
deal.II/examples/doxygen/theta_timestepping.cc

index 931a1641ce4bc23b47c8336f610fc0b0f16e6f7e..c71b81e6d5fba094fe0a57eadbf2335df6e81746 100644 (file)
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
 //
-//    Copyright (C) 2005, 2006 by the deal.II authors
+//    Copyright (C) 2005, 2006, 2010 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -10,7 +10,7 @@
 //
 //---------------------------------------------------------------------------
 
-// See documentation of Product for documentation of this example
+// See documentation of ProductMatrix for documentation of this example
 
 #include <base/logstream.h>
 #include <lac/matrix_lib.h>
index 6f42cbd37fac5f872383c1d66deee52657f19c49..a3c9436ef024a075ea9ada5b9b91f1a163017629 100644 (file)
@@ -82,7 +82,10 @@ int main()
 Explicit::Explicit(const FullMatrix<double>& M)
                :
                matrix(&M)
-{}
+{
+  m.reinit(M.m(), M.n());
+  m = M;
+}
 
 
 void
@@ -97,6 +100,7 @@ Explicit::operator() (NamedData<Vector<double>*>& out, const NamedData<Vector<do
 {
   this->notifications.print(deallog);
   deallog << std::endl;
+  this->notifications.clear();
   unsigned int i = in.find("Previous time");
   m.vmult(*out(0), *in(i));
 }
@@ -105,7 +109,9 @@ Explicit::operator() (NamedData<Vector<double>*>& out, const NamedData<Vector<do
 Implicit::Implicit(const FullMatrix<double>& M)
                :
                matrix(&M)
-{}
+{
+  m.reinit(M.m(), M.n());
+}
 
 
 void
@@ -120,6 +126,15 @@ Implicit::operator() (NamedData<Vector<double>*>& out, const NamedData<Vector<do
 {
   this->notifications.print(deallog);
   deallog << std::endl;
+  if (this->notifications.test(Events::initial) || this->notifications.test(Events::new_timestep_size))
+    {
+      m.equ(timestep_data->step, *matrix);
+      for (unsigned int i=0;i<m.m();++i)
+       m(i,i) += 1.;
+      m.gauss_jordan();
+    }
+  this->notifications.clear();
+  
   unsigned int i = in.find("Previous time");
   m.vmult(*out(0), *in(i));
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.