]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Additions to the text.
authorschrage <schrage@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 29 Apr 1999 13:58:54 +0000 (13:58 +0000)
committerschrage <schrage@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 29 Apr 1999 13:58:54 +0000 (13:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@1224 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/tutorial/chapter-1.elements/condense.html
deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html
deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html
deal.II/doc/tutorial/chapter-1.elements/rhs.html

index cfbbc4a0cc11de3d6be46f5a20ad7ccc0166278f..49c92e9fd5995c25bfe04c70e0f677bf824cfaff 100644 (file)
@@ -67,13 +67,13 @@ function calls needed. Be sure to use them in their appropriate places.
 #include &lt;grid/dof_constraints.h&gt;
 
 int dim=2; // Work in two dimensions, could also be three
-SparseMatrixStruct&lt;double&gt; smstruct;
+SparseMatrixStruct&lt;double&gt; sparsity_pattern;
 DoFHandler&lt;dim&gt; dof;
 ConstraintMatrix&lt;dim&gt; hanging_nodes; 
 
 
 hanging_nodes.clear();
-dof.make_sparsity_pattern(smstruct);
+dof.make_sparsity_pattern(sparsity_pattern);
 dof.make_hanging_nodes_constraints(hanging_nodes);
 dof.constraints.close();
 hanging_nodes.condense(matrix_structure);
index 2446786e0655e7eef50076857339183165436ca8..d295c36c3d0cbba8a2974bae1de825254c027a99 100644 (file)
@@ -27,10 +27,6 @@ There are several kinds of matrices we will deal with:
 cells have non-zero values.
 </li>
 <li>
-<a href="#block">Block sparse matrices</a> where the matrix is assumed to 
-consist of blocks on the diagonal.
-</li>
-<li>
 <a href="#sparse">Sparse matrices</a>, i.e. matrices where the majority of 
 cells has zero value.
 </li>
@@ -90,62 +86,20 @@ appropriate places. This example initializes a sparse square matrix structure.
 
 
 int dim=2; // For example
-SparseMatrixStruct&lt;double&gt; smstruct;
+SparseMatrixStruct&lt;double&gt; sparsity_pattern;
 SparseMatrix&lt;double&gt; sm;
 DoFHandler&lt;dim&gt; dof;
 
 // Your degrees of freedom must already be distributed
 
-smstruct.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs());
-
-// If your grid is locally refined, <a href="matrix_structure.html#smstruct">condense the hanging nodes</a> into the
-// structure.
-
-smstruct.compress();
-
-sm.reinit(smstruct);
-</code>
-</pre>
-
-<h3><a name="block">The block sparse matrix</a></h3>
-
-<p>
-A block matrix is assumed to consist of blocks on the diagonal with all
-the blocks having the same size.
-It is initialized using 
-<code>BlockSparseMatrix::reinit(const SparseMatrixStruct &amp;sparsity)</code>
-Since this is a sparse matrix, i.e. a matrix that can be
-stored efficiently, we need to generate a matrix structure first, like for the 
-sparse matrix. In fact, the block sparse matrix is just a specialization of
-the sparse matrix.
-</p>
-
-<p class="Example">
-<span class="example">Example:</span> We show the include files you need, 
-the definitions and the function calls. Make sure to use them in their
-appropriate places. 
-</p>
-<pre class="example">
-<code>
-#include &lt;grid/dof.h&gt;
-#include &lt;lac/blocksparsematrix.h&gt;
-
-int dim=2; // 2 Dimensions, could also be three
-SparseMatrixStruct&lt;double&gt; smstruct;
-DoFHandler&lt;dim&gt; dof;
-BlockSparseMatrix&lt;double&gt; A;
-
-
-// Your degrees of freedom must already be distributed
-
-smstruct.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs());
+sparsity_pattern.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs());
 
-// If your grid is locally refined, <a href="matrix_structure.html#smstruct">condense the hanging nodes</a> into the
+// If your grid is locally refined, <a href="matrix_structure.html#sparsity_pattern">condense the hanging nodes</a> into the
 // structure.
 
-smstruct.compress();
+sparsity_pattern.compress();
 
-A.reinit(smstruct);
+sm.reinit(sparsity_pattern);
 </code>
 </pre>
 
index b4be08b593d093ca30557fb929f161b026dd50e6..f3a21e92cd3cee0eaa897656487b08c302e07f2a 100644 (file)
@@ -52,7 +52,7 @@ matrix given by the <a href="hanging_nodes.html">hanging nodes</a>.
 </p>
 
 <p class="Example">
-<a name="smstruct"><span class="example">Example:</span></a> We show the include files you need, 
+<a name="sparsity_pattern"><span class="example">Example:</span></a> We show the include files you need, 
 the definitions and the function calls. Make sure to use them in their
 appropriate places. This example initializes a sparse square matrix structure.
 </p>
@@ -63,13 +63,13 @@ appropriate places. This example initializes a sparse square matrix structure.
 
 
 int dim=2; // For example
-SparseMatrixStruct&lt;double&gt; smstruct;
+SparseMatrixStruct&lt;double&gt; sparsity_pattern;
 DoFHandler&lt;dim&gt; dof;
 ConstraintMatrix hanging_nodes;  // Only necessary for locally refined grids
 
 // Your degrees of freedom must already be distributed
 
-smstruct.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs());
+sparsity_pattern.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs());
 
 // Condense the <a href="hanging_nodes.html">hanging nodes</a> into
 // the matrix, taking into account the constraints to the hanging nodes.
@@ -77,10 +77,10 @@ smstruct.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs());
 // on locally refined grids.
 // You can skip this part if your grid is not locally refined.
 
-dof.make_sparsity_pattern(smstruct); 
+dof.make_sparsity_pattern(sparsity_pattern); 
 hanging_nodes.clear();
 dof.make_constraint_matrix(hanging_nodes);
-hanging_nodes.condense(smstruct);
+hanging_nodes.condense(sparsity_pattern);
 
 </code>
 </pre>
@@ -112,12 +112,12 @@ The appropriate function is <code>void SparseMatrixStruct::compress()</code>.
 </p>
 
 <p class="Example">
-<span class="example">Example:</span> Starting from <a href="#smstruct">the example above</a>, we
-compress our matrix structure <code>smstruct</code>.
+<span class="example">Example:</span> Starting from <a href="#sparsity_pattern">the example above</a>, we
+compress our matrix structure <code>sparsity_pattern</code>.
 </p>
 <pre class="example">
 <code>
-smstruct.compress();
+sparsity_pattern.compress();
 </code>
 </pre>
 
index 8d15cdc412d5450e2ef63754e4955d61cb60e123..289c6b592e8da27ef765fbfa0ae221d6cdd743fc 100644 (file)
@@ -120,16 +120,16 @@ for (DoFHandler&lt;2&gt;::active_cell_iterator c = dof.begin_active()
   fevalues.reinit(c, stb);
   elmat.clear();
   elvec.clear();
-  c->get_dof_indices(indices);
+  c-&gt;get_dof_indices(indices);
     
-  for (unsigned k=0;k<qc.n_quadrature_points;++k)
+  for (unsigned k=0;k&lt;qc.n_quadrature_points;++k)
   {
-    for (unsigned i=0;i<fe.total_dofs;++i)
+    for (unsigned i=0;i&lt;fe.total_dofs;++i)
     {
       const Point&lt;2&gt; dv = fevalues.shape_grad(i,k);
 
        
-      for (unsigned j=0;j<fe.total_dofs;++j)
+      for (unsigned j=0;j&lt;fe.total_dofs;++j)
       {
        const Point&lt;2&gt; du = fevalues.shape_grad(j,k);
          
@@ -141,11 +141,11 @@ for (DoFHandler&lt;2&gt;::active_cell_iterator c = dof.begin_active()
     }
   }
   // ...and insert the local matrix into the global one.
-  for (unsigned i=0;i<fe.total_dofs;++i)
+  for (unsigned i=0;i&lt;fe.total_dofs;++i)
   {
     f(indices[i]) += elvec(i);
             
-    for (unsigned j=0;j<fe.total_dofs;++j)
+    for (unsigned j=0;j&lt;fe.total_dofs;++j)
     {
       A.add(indices[i], indices[j], elmat(i,j));
     }

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.