]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add preliminary solver support.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 16 Mar 1998 08:35:53 +0000 (08:35 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 16 Mar 1998 08:35:53 +0000 (08:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@69 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/base.h
deal.II/deal.II/source/numerics/base.cc

index ec9f7e6548cda6d213ee20ecc34ef60aa5450eb9..debc6fd6a5aaf627a60350866817deb5c9877b3f 100644 (file)
@@ -13,6 +13,7 @@ template <int dim> class Triangulation;
 template <int dim> class DoFHandler;
 template <int dim> class FiniteElement;
 template <int dim> class Quadrature;
+template <int dim> class DataOut;
 
 
 
@@ -72,6 +73,10 @@ class ProblemBase {
                           const Quadrature<dim>    &q,
                           const FiniteElement<dim> &fe);
 
+
+    void solve ();
+    void fill_data (DataOut<dim> &) const;
+    
                                     /**
                                      * Exception
                                      */
index 1bd73903bfe7579a255d6c7819996622971acc8e..755a0478503e297f02e0fc3e338d47fb9b621f8e 100644 (file)
@@ -4,9 +4,14 @@
 #include <numerics/base.h>
 #include <grid/dof_constraints.h>
 #include <grid/tria_iterator.h>
+#include <basic/data_io.h>
 
 
-extern TriaActiveIterator<1,CellAccessor<1> > __dummy1233; // for gcc2.8
+#include "../../../mia/vectormemory.h"
+#include "../../../mia/control.h"
+#include "../../../mia/cg.h"
+
+extern TriaActiveIterator<1,CellAccessor<1> > __dummy1233; // for gcc2.7
 extern TriaActiveIterator<2,CellAccessor<2> > __dummy1234;
 
 
@@ -81,6 +86,29 @@ void ProblemBase<dim>::assemble (const Equation<dim>   &equation,
 
 
 
+template <int dim>
+void ProblemBase<dim>::solve () {
+  int    max_iter  = 4000;
+  double tolerance = 1.e-14;
+  
+  Control                          control1(max_iter,tolerance);
+  PrimitiveVectorMemory<dVector>   memory(right_hand_sides[0]->n());
+  CG<dSMatrix,dVector>             cg(control1,memory);
+
+  cg (system_matrix, solution, *right_hand_sides[0]);
+};
+
+
+
+template <int dim>
+void ProblemBase<dim>::fill_data (DataOut<dim> &out) const {
+  out.clear_data_vectors ();
+  out.attach_dof_handler (*dof_handler);
+  out.add_data_vector (solution, "solution");
+};
+
+  
+  
 
 
 // explicit instantiations

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.