]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Wolfs suggestions + various additions and corrections.
authorschrage <schrage@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 May 1999 17:19:12 +0000 (17:19 +0000)
committerschrage <schrage@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 May 1999 17:19:12 +0000 (17:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@1280 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/tutorial/chapter-1.elements/boundary.html
deal.II/doc/tutorial/chapter-1.elements/condense.html
deal.II/doc/tutorial/chapter-1.elements/dofs.html
deal.II/doc/tutorial/chapter-1.elements/grid_creation.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 9d19bc392f0e950fb67b062e5364bba3ff7faf56..7151dd29338b437ad53ad388c7e9f06b8aaa3a2f 100644 (file)
@@ -58,7 +58,7 @@ DoFHandler&lt;2&gt;::FunctionMap dirichlet_bc;
 BoundaryFct bfct;
 dirichlet_bc[0]=&amp;bfct;
 VectorTools&lt;2&gt;::interpolate_boundary_values(dof,dirichlet_bc,fe,boundary,boundary_values);
-u.reinit(f);
+u.reinit(f.size());
 MatrixTools&lt;2&gt;::apply_boundary_values(boundary_values,A,u,f);  
 </code></pre>
 <p>
@@ -82,7 +82,9 @@ This may seem a bit confusing. What actually happens is the following:
 <code>bfct</code>, its relation to boundaries <code>dirichlet_bc</code> and
 the triangulation <code>dof, fe</code> and returns a
 mapping <code>boundary_values</code> that maps values instead of functions
-to our boundaries. The function looks at <em>all</em> the boundaries. All we
+to our boundaries. The function looks at all the boundaries the index
+of which is listed in <code>dirichlet_bc</code> (in this example, all
+the boundaries with indicator 0). All we
 ever need to do is specify the initial triangulation.
 </li>
 <li><code>apply_boundary_values</code> subsequently takes that mapping and
index 49c92e9fd5995c25bfe04c70e0f677bf824cfaff..af516c5a89f42976e6eb36dc4206c81f730194bd 100644 (file)
@@ -66,7 +66,7 @@ function calls needed. Be sure to use them in their appropriate places.
 #include &lt;lac/sparsematrix.h&gt;
 #include &lt;grid/dof_constraints.h&gt;
 
-int dim=2; // Work in two dimensions, could also be three
+const unsigned int dim=2; // Work in two dimensions, could also be three
 SparseMatrixStruct&lt;double&gt; sparsity_pattern;
 DoFHandler&lt;dim&gt; dof;
 ConstraintMatrix&lt;dim&gt; hanging_nodes; 
@@ -75,7 +75,7 @@ ConstraintMatrix&lt;dim&gt; hanging_nodes;
 hanging_nodes.clear();
 dof.make_sparsity_pattern(sparsity_pattern);
 dof.make_hanging_nodes_constraints(hanging_nodes);
-dof.constraints.close();
+hanging_nodes.close();
 hanging_nodes.condense(matrix_structure);
 
 </code>
index 97872f0c7cd3823bd76a29c45b2db90317442012..f11c483f50884d754b072a438a35b7faf6e05a5c 100644 (file)
@@ -88,7 +88,7 @@ offers the function<br>
 <code>void DoFHandler::renumber_dofs(const RenumberingMethod method,const bool use_constraints=false, const vector&lt;int&gt; &amp;starting_points=vector&lt;int&gt;())</code><br>
 or alternatively, the easier to use<br>
 <code>void DoFHandler::renumber_dofs(const RenumberingMethod method)</code><br>
-The methods available are <code>Cuthill_McKey</code> and <code>reverse_Cuthill_McKey</code>. Both algorithms are usually better than the one used
+The methods available are <code>Cuthill_McKee</code> and <code>reverse_Cuthill_McKee</code>. Both algorithms are usually better than the one used
 by <code>distribute_dofs</code> and neither is optimal (there is no algorithm
 that accomplishes optimal results within a reasonable amount of time).
 Both algorithms require a good index to start with to achieve good results.
@@ -99,11 +99,11 @@ in every other case the second way is more advisable.
 <span class="example">Example:</span> We use the definitions from the
 <a href="#ex_distribute">first example</a> given above. We renumber our 
 degrees of freedom with the 
-<code>Cuthill_McKey</code> method.
+<code>Cuthill_McKee</code> method.
 </p>
 <pre class="example">
 <code>
-dof.renumber_dofs(Cuthill_McKey);
+dof.renumber_dofs(Cuthill_McKee);
 </code>
 </pre>
 
index 2a88d0fdd220d659c82b2641b035c6806a0d502c..438b358d950b856f1f88eae703ef068fa716d1b0 100644 (file)
@@ -54,7 +54,7 @@ function calls needed. Be sure to use them in their appropriate places.
 <code>
 #include &lt;grid/tria.h&gt;
 
-int dim=2;  // Two dimensions; to create a cube set to three
+const unsigned int dim=2;  // Two dimensions; to create a cube set to three
 Triangulation&lt;dim&gt; tr;
 
 tr.create_hypercube(-1,1);
@@ -87,7 +87,7 @@ This example will create a hyperball with unit radius centred on (1,0).
 #include &lt;grid/tria.h&gt;
 #include &lt;base/point.h&gt;
 
-int dim=2;  // For example
+const unsigned int dim=2;  // For example
 Triangulation&lt;dim&gt; tr;
 Point&lt;dim&gt; centre(1,0); // Taking (1,0) as the centre of the ball
 
@@ -132,7 +132,7 @@ This example will create the default hyper-L.
 <code>
 #include &lt;grid/tria.h&gt;
 
-int dim=2;  // For example
+const unsigned int dim=2;  // For example
 Triangulation&lt;dim&gt; tr;
 
 tr.create_hyper_L(-1,1);
index d295c36c3d0cbba8a2974bae1de825254c027a99..d41ce8246c56f4f3a1524708f73d65790c35d5ff 100644 (file)
@@ -28,7 +28,7 @@ cells have non-zero values.
 </li>
 <li>
 <a href="#sparse">Sparse matrices</a>, i.e. matrices where the majority of 
-cells has zero value.
+cells has zero value; these zeroes are not stored in order to save memory.
 </li>
 </ul>
 
@@ -44,8 +44,8 @@ int rows, const unsigned int cols)</code>.
 <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. This example initializes a full matrix of doubles
-with 100 rows and 50 columns.
+appropriate places. This example initializes two full matrices of doubles
+with 100 rows and 50 columns in two different ways.
 </p>
 <pre class="example">
 <code>
@@ -55,6 +55,11 @@ with 100 rows and 50 columns.
 FullMatrix&lt;double&gt; A;
 
 A.reinit(100,50);
+
+// or, alternatively (important for const objects):
+
+FullMatrix&lt;double&gt; B(100,50);
+
 </code>
 </pre>
 
@@ -85,9 +90,9 @@ appropriate places. This example initializes a sparse square matrix structure.
 #include &lt;lac/sparsematrix.h&gt;
 
 
-int dim=2; // For example
+const unsigned int dim=2; // For example
 SparseMatrixStruct&lt;double&gt; sparsity_pattern;
-SparseMatrix&lt;double&gt; sm;
+SparseMatrix&lt;double&gt; sparse_matrix;
 DoFHandler&lt;dim&gt; dof;
 
 // Your degrees of freedom must already be distributed
@@ -99,7 +104,7 @@ sparsity_pattern.reinit(dof.n_dofs(),dof.n_dofs(),dof.max_couplings_between_dofs
 
 sparsity_pattern.compress();
 
-sm.reinit(sparsity_pattern);
+sparse_matrix.reinit(sparsity_pattern);
 </code>
 </pre>
 
index f3a21e92cd3cee0eaa897656487b08c302e07f2a..b798d0b5eb6ffd39d72c92ead1528969f543568b 100644 (file)
@@ -45,6 +45,9 @@ the size of the matrix in question and the maximum number of non-zero elements
 in one row.
 This number can be calculated with 
 <code>int DoFHandler::max_couplings_between_dofs()</code>.
+<em>Beware: This function was written to cope with refined grids only !
+If your grid consists exclusively of cells next to boundaries its 
+return value will be wrong.</em>
 This matrix structure can then be used to generate a matrix using 
 <code>void SparseMatrix::reinit(const SparseMatrixStruct &sparsity)</code>.
 In cases of locally refined grids you will also need to take care of the constraints to your
@@ -62,7 +65,7 @@ appropriate places. This example initializes a sparse square matrix structure.
 #include &lt;lac/sparsematrix.h&gt;
 
 
-int dim=2; // For example
+const unsigned int dim=2; // For example
 SparseMatrixStruct&lt;double&gt; sparsity_pattern;
 DoFHandler&lt;dim&gt; dof;
 ConstraintMatrix hanging_nodes;  // Only necessary for locally refined grids
index 289c6b592e8da27ef765fbfa0ae221d6cdd743fc..9490c77f1c3e18fc7dc5ad23e3a241601f1214f2 100644 (file)
@@ -38,16 +38,20 @@ we shall now discuss how to fill them. You have to:
 <p class="Example">
 <span class="example">Example:</span>
 The two lines below calculate trial functions for the two-dimensional finite element <code>fe</code> and
-for its faces using Gaussian quadrature. The first line calculates the trial
-function for the finite element associated with the degree of freedom <code>dof</code>,
-updating the values of the gradients and of the Jacobi determinant multiplied by a
-weight function given by the quadrature <code>qc</code>. The second line 
-does the same for the faces of the finite element, updating the <code>JxW</code>
-values and the quadrature points.
+for its faces using Gaussian quadrature. The first line initializes
+an object for the trial function of
+function for the finite element associated with the degree of freedom
+handler <code>dof</code>, telling it to 
+update the values of the gradients and of the Jacobi determinant
+multiplied by a
+weight function given by the quadrature <code>qc</code>
+whenever <code>fe_values.reinit(fe)</code> is called. The second line 
+does the same for the faces of the finite element, telling it to update the 
+<code>JxW</code> values and the quadrature points.
 </p>
 <pre class="example">
 <code>
-// Calculate the trial functions on the cell faces.
+// Initialize the trial functions on the cell faces.
 FEValues&lt;2&gt; fevalues(fe, qc, UpdateFlags(update_gradients |
                                           update_JxW_values));
 FEFaceValues&lt;2&gt; ffvalues(fe, qf,

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.