From: schrage Date: Thu, 15 Apr 1999 15:08:03 +0000 (+0000) Subject: Enhanced examples + some bugfixes. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63358d3837c487cfe505f437c07ad707c8b6f775;p=dealii-svn.git Enhanced examples + some bugfixes. git-svn-id: https://svn.dealii.org/trunk@1150 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/tutorial/chapter-1.elements/grid_creation.html b/deal.II/doc/tutorial/chapter-1.elements/grid_creation.html index 68d0b2e442..076e76bbd8 100644 --- a/deal.II/doc/tutorial/chapter-1.elements/grid_creation.html +++ b/deal.II/doc/tutorial/chapter-1.elements/grid_creation.html @@ -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.

 
-const Point<2&rt; vertices[8] = { Point<2&rt; (0,0),               
-                                 Point<2&rt; (1,0),               
-                                 Point<2&rt; (1,1),
-                                 Point<2&rt; (0,1),            
-                                 Point<2&rt; (2,0),        
-                                 Point<2&rt; (2,1),         
-                                 Point<2&rt; (3,0),      
-                                 Point<2&rt; (3,1)  };
+// First, create an array holding the (2-dimensional) vertices
+const Point<2> vertices[8] = { Point<2> (0,0),               
+                                 Point<2> (1,0),               
+                                 Point<2> (1,1),
+                                 Point<2> (0,1),            
+                                 Point<2> (2,0),        
+                                 Point<2> (2,1),         
+                                 Point<2> (3,0),      
+                                 Point<2> (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<CellData<2&rt; &rt; cells (3, CellData<2&rt;());                
-                                                                                
+
+// Next, create a vector of type CellData<2> that holds the
+// cells
+vector<CellData<2> > cells (3, CellData<2>());             
+
+// 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<3; ++i)                                        
   {                                                         
     for (unsigned int j=0; j<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<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<Point<2&rt; &rt;(&vertices[0],
+
+// We are using a boundary of cell number 1
+boundary_info.boundary_lines.push_back (CellData<1>());
+
+// 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->create_triangulation (vector<Point<2> >(&vertices[0],
                                                        &vertices[8]),
                                                        cells, boundary_info);
 
diff --git a/deal.II/doc/tutorial/chapter-1.elements/hanging_nodes.html b/deal.II/doc/tutorial/chapter-1.elements/hanging_nodes.html
index d5aa7d512a..1dbbbed182 100644
--- a/deal.II/doc/tutorial/chapter-1.elements/hanging_nodes.html
+++ b/deal.II/doc/tutorial/chapter-1.elements/hanging_nodes.html
@@ -41,21 +41,6 @@ dealing with hanging nodes:
 
  • -

    -Example: 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. -

    -
    -
    -NOT FINISHED
    -
    -hanging_nodes.clear();
    -dof.make_constraint_matrix(hanging_nodes);
    -hanging_nodes.condense(matrix_structure);
    -
    -
    NOT FINISHED diff --git a/deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html b/deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html index 63734c3b8f..e0de64eba1 100644 --- a/deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html +++ b/deal.II/doc/tutorial/chapter-1.elements/matrix_generation.html @@ -38,6 +38,12 @@ DoFHandler<dim> 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, condense the hanging nodes into the +// structure. + +smstruct.compress(); + sm.reinit(smstruct);
    diff --git a/deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html b/deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html index 3a601a6a43..b4be08b593 100644 --- a/deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html +++ b/deal.II/doc/tutorial/chapter-1.elements/matrix_structure.html @@ -65,6 +65,7 @@ appropriate places. This example initializes a sparse square matrix structure. int dim=2; // For example SparseMatrixStruct<double> smstruct; DoFHandler<dim> dof; +ConstraintMatrix hanging_nodes; // Only necessary for locally refined grids // Your degrees of freedom must already be distributed @@ -126,7 +127,7 @@ smstruct.compress();