]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Enhanced examples + some bugfixes.
authorschrage <schrage@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Apr 1999 15:08:03 +0000 (15:08 +0000)
committerschrage <schrage@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Apr 1999 15:08:03 +0000 (15:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@1150 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/tutorial/chapter-1.elements/grid_creation.html
deal.II/doc/tutorial/chapter-1.elements/hanging_nodes.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/template.html

index 68d0b2e44235ac2d0695e020190cd938c558e3bf..076e76bbd862fe7f6412341c8e114453c68277c8 100644 (file)
@@ -160,43 +160,58 @@ to create a triangulation. This is probably best illustrated by an example.
 definitions and
 function calls needed. Be sure to use them in their appropriate places.
 This example will create a triangulation as shown in this figure. It will
-work only in two dimensions.
+work only in two dimensions. It creates three rectangular cells, the leftmost 
+boundary is a Neumann-boundary.
 </p>
 <pre class="example">
 <code>
-const Point&lt;2&rt; vertices[8] = { Point&lt;2&rt; (0,0),               
-                                 Point&lt;2&rt; (1,0),               
-                                 Point&lt;2&rt; (1,1),
-                                 Point&lt;2&rt; (0,1),            
-                                 Point&lt;2&rt; (2,0),        
-                                 Point&lt;2&rt; (2,1),         
-                                 Point&lt;2&rt; (3,0),      
-                                 Point&lt;2&rt; (3,1)  };
+// First, create an array holding the (2-dimensional) vertices
+const Point&lt;2&gt; vertices[8] = { Point&lt;2&gt; (0,0),               
+                                 Point&lt;2&gt; (1,0),               
+                                 Point&lt;2&gt; (1,1),
+                                 Point&lt;2&gt; (0,1),            
+                                 Point&lt;2&gt; (2,0),        
+                                 Point&lt;2&gt; (2,1),         
+                                 Point&lt;2&gt; (3,0),      
+                                 Point&lt;2&gt; (3,1)  };
+
+// Next, create a two-dimensional array holding the information
+// on what cell consists of which vertices
 const int cell_vertices[3][4] = {{0, 1, 2, 3},      
                                  {1, 4, 5, 2},
                                  {4, 6, 7, 5}};
-                                                                            
-vector&lt;CellData&lt;2&rt; &rt; cells (3, CellData&lt;2&rt;());                
-                                                                                
+
+// Next, create a vector of type CellData&lt;2&gt; that holds the
+// cells
+vector&lt;CellData&lt;2&gt; &gt; cells (3, CellData&lt;2&gt;());             
+
+// The information on the cells is copied into this vector and the 
+// material is set to 0. This index can be used to distinguish cells
+// of different types. 
 for (unsigned int i=0; i&lt;3; ++i)                                        
   {                                                         
     for (unsigned int j=0; j&lt;4; ++j)        
       cells[i].vertices[j] = cell_vertices[i][j];
     cells[i].material_id = 0;
   };
-                                                                         
+
+// The Neumann boundary is set below:
+// Boundaries are parts of cells, therefore the class is called SubCellData
+// to distinguish them from cell data like vertices and material.
 SubCellData boundary_info;                                       
-if (boundary_conditions == wave_from_left_bottom)                
-  {                                               
-                                     // use Neumann bc at left
-                                     // (mirror condition)
-    boundary_info.boundary_lines.push_back (CellData&lt;1&rt;());
-    boundary_info.boundary_lines.back().material_id = 1;
-    boundary_info.boundary_lines[0].vertices[0] = 0; 
-    boundary_info.boundary_lines[0].vertices[1] = 3;
-  };                                          
-                                                       
-coarse_grid-&rt;create_triangulation (vector&lt;Point&lt;2&rt; &rt;(&vertices[0],
+
+// We are using a boundary of cell number 1
+boundary_info.boundary_lines.push_back (CellData&lt;1&gt;());
+
+// The boundary gets a material id of 
+boundary_info.boundary_lines.back().material_id = 1;
+
+// The boundary is between vertices number 1 and 3
+boundary_info.boundary_lines[0].vertices[0] = 0; 
+boundary_info.boundary_lines[0].vertices[1] = 3;
+
+// From this information the triangulation is created 
+coarse_grid-&gt;create_triangulation (vector&lt;Point&lt;2&gt; &gt;(&vertices[0],
                                                        &vertices[8]),
                                                        cells, boundary_info);
 </code>
index d5aa7d512a2f61dd1bfd9dc2695c16be3a8abc7f..1dbbbed18220331980e7cbb7ca5058a5a894256e 100644 (file)
@@ -41,21 +41,6 @@ dealing with hanging nodes:
 <li></li>
 </ul>
 
-<p class="Example">
-<span class="example">Example:</span> We will create a
-constraint matrix for hanging nodes and condense the hanging nodes into our matrix structure. Below we show the includes,
-definitions and
-function calls needed. Be sure to use them in their appropriate places.
-</p>
-<pre class="example">
-<code>
-NOT FINISHED
-
-hanging_nodes.clear();
-dof.make_constraint_matrix(hanging_nodes);
-hanging_nodes.condense(matrix_structure);
-</code>
-</pre>
 
 NOT FINISHED
 
index 63734c3b8f509104be9a83829996e699cfd2eba8..e0de64eba1544142e9f7634ca946eb8ffeed99bc 100644 (file)
@@ -38,6 +38,12 @@ 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 you 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>
index 3a601a6a43287521d143163036ca1379d5789d9e..b4be08b593d093ca30557fb929f161b026dd50e6 100644 (file)
@@ -65,6 +65,7 @@ appropriate places. This example initializes a sparse square matrix structure.
 int dim=2; // For example
 SparseMatrixStruct&lt;double&gt; smstruct;
 DoFHandler&lt;dim&gt; dof;
+ConstraintMatrix hanging_nodes;  // Only necessary for locally refined grids
 
 // Your degrees of freedom must already be distributed
 
@@ -126,7 +127,7 @@ smstruct.compress();
 <table class="navbar">      
 <tr>
   <td>
-    <a href="matrix_generation.html">Next Chapter: MAtrix and Vector Generation</a>
+    <a href="matrix_generation.html">Next Chapter: Matrix and Vector Generation</a>
   </td>
   <td>
     <a href="toc.html">Back to this chapter's index</a>
index ab1c6e6ff1a7ebdcad59597b906b45ea7e4da752..f54ff94aa4f6cbe971dd594e1baf00aa56e06310 100644 (file)
 
 <h1></h1>
 
-
 <!-- Page Foot -->
 <hr>
 <table class="navbar">      
 <tr>
+  <td>
+    <a href="URLS_NEEDS_TO_BE_SET">Next Chapter: </a>
+  </td>
   <td>
     <a href="toc.html">Back to this chapter's index</a>
   </td>

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.