From 52e78a895789a5f8c1f89982865f3e2329b3fba5 Mon Sep 17 00:00:00 2001 From: schrage Date: Fri, 16 Apr 1999 12:39:48 +0000 Subject: [PATCH] First check-in git-svn-id: https://svn.dealii.org/trunk@1170 0785d39b-7218-0410-832d-ea1e28bc413d --- .../tutorial/chapter-1.elements/condense.html | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 deal.II/doc/tutorial/chapter-1.elements/condense.html diff --git a/deal.II/doc/tutorial/chapter-1.elements/condense.html b/deal.II/doc/tutorial/chapter-1.elements/condense.html new file mode 100644 index 0000000000..37484bc865 --- /dev/null +++ b/deal.II/doc/tutorial/chapter-1.elements/condense.html @@ -0,0 +1,106 @@ + + + + + +Condensing the Hanging Nodes + + + + + + + + +

Condensing the Hanging Nodes

+ +

+On locally refined grids you get hanging nodes +that need to be integrated into your problem matrix, and before that, into +the matrix structure. Hanging nodes are +constrained degrees of freedom; these constraints need to be taken into +account when dealing with them. +

+

+The deal.II class +that has the ability to handle constraint matrices is called +ConstraintMatrix. It provides all functions +necessary to condense hanging nodes into a matrix structure. +You will have to: +

    +
  1. Clear the hanging nodes so there is no mess left from previous use. + Clearing them if they are already cleared doesn't hurt. This is + accomplished with the function void ConstraintMatrix::clear(). +
  2. +
  3. +Create a global sparsity pattern (as described in the chapter on +matrix structure) using +void DoFHandler::make_sparsity_pattern(SparseMatrixStruct &). +
  4. +
  5. +Create the constraints on the hanging nodes using +void DoFHandler::make_constraint_matrix(ConstraintMatrix &). +
  6. +
  7. Close the constraints matrix using void DoFHandler<dim>::constraints::close(). +This method is needed because you might wish to implement additional constraints +(apart from those for the hanging nodes). This would have to be done before +closing the object. So you can't have it closed automatically somewhere. +
  8. +
  9. Finally, condense the hanging nodes into the matrix structure +using ConstraintMatrix::condense(SparseMatrixStruct &). +
  10. +
+ +

+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. +

+
+
+#include <grid/dof.h>
+#include <lac/sparsematrix.h>
+#include <grid/dof_constraints.h>
+
+int dim=2; // Work in two dimensions, could also be three
+SparseMatrixStruct<double> smstruct;
+DoFHandler<dim> dof;
+ConstraintMatrix<dim> hanging_nodes; 
+
+
+hanging_nodes.clear();
+dof.make_sparsity_pattern(smstruct);
+dof.make_hanging_nodes_constraints(hanging_nodes);
+dof.constraints.close();
+hanging_nodes.condense(matrix_structure);
+
+
+
+ + +
+ + + + + + + +
+
+Jan Schrage
+

+Last modified: $Date$ +

+ + -- 2.39.5