]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move the DoFLevel class to an own include file since most classes need not know about...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 25 Aug 1998 12:44:12 +0000 (12:44 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 25 Aug 1998 12:44:12 +0000 (12:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@511 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/include/dofs/dof_levels.h [new file with mode: 0644]
deal.II/deal.II/source/dofs/dof_accessor.cc
deal.II/deal.II/source/dofs/dof_handler.cc

index 9b65bc673b814f3e49f9ad1f786399355e13c774..58634fe5bcf7bf85d9389a66b579c16c19feb350 100644 (file)
@@ -20,6 +20,8 @@ template <int dim, class BaseClass> class DoFLineAccessor;
 template <int dim, class BaseClass> class DoFQuadAccessor;
 template <int dim> class DoFCellAccessor;
 
+template <int dim> class DoFLevel;
+
 
 template <int dim, class Accessor> class TriaRawIterator;
 template <int dim, class Accessor> class TriaIterator;
@@ -37,86 +39,6 @@ class ConstraintMatrix;
 
 
 
-/**
- * Store the indices of the degrees of freedom which are located on the lines.
- * Declare it to have a template parameter, but do not actually declare
- * other types than those explicitely instantiated.
- */
-template <int N>
-class DoFLevel;
-
-
-
-
-
-/**
- * Store the indices of the degrees of freedom which are located on the lines.
- *
- * \subsection{Information for all #DoFLevel# classes}
- *
- * The #DoFLevel<N># classes 
- * store the global indices of the degrees of freedom for each cell on a
- * certain level. The index or number of a degree of freedom is the zero-based
- * index of the according value in the solution vector and the row and column
- * index in the global matrix or the multigrid matrix for this level. These
- * indices refer to the unconstrained vectors and matrices, where we have not
- * taken account of the constraints introduced by hanging nodes. If more than
- * one value corresponds to one basis function, for example for vector equations
- * where the solution is vector valued and thus has several degrees of freedom
- * for each basis function, we nonetheless store only one index. This can then
- * be viewed as the index into a block vector, where each block contains the
- * different values according to a degree of freedom. It is left to the derived
- * classes, whether the values in a block are stored consecutively or distributed
- * (e.g. if the solution function is $u=(u_1, u_2)$, we could store the values
- * in the solution vector like
- * $\ldots, u_1^m, u_2^m, u_1^{m+1}, u_2^{m+1},\ldots$ with $m$ denoting the
- * $m$th basis function, or $\ldots, u_1^m, u_1^{m+1}, u_1^{m+2}, \ldots,
- * u_2^m, u_2^{m+1}, u_2^{m+2}, \ldots$, respectively). Likewise, the
- * constraint matrix returned by #DoFHandler::make_constraint_matrix ()# is then
- * to be understood as a block matrix.
- *
- * The storage format of the degrees of freedom indices (short: DoF indices) is
- * somewhat like a mirror of the data structures of the triangulation classes.
- * There is a hierarchy of #DoFLevel<dim># classes for the different dimensions
- * which have objects named #line_dofs#, #quad_dofs# and so on, in which the
- * indices of DoFs located on lines and quads, respectively, are stored. The
- * indices are stored levelwise. The layout in
- * these arrays is as follows: if for a selected finite element (use
- * #DoFHandler::distribute_dofs()# to select a finite element) the number of
- * DoFs on each line (without those in the vertices) is #N#, then the length
- * of the #line_dofs# array is #N# times the number of lines on this level. The
- * DoF indices for the #i#th line are at the positions #N*i...(N+1)*i-1#.
- *
- * The DoF indices for vertices are not stored this way, since they need
- * different treatment in multigrid environments. If no multigrid is used, the
- * indices are stored in the #vertex_dofs# array of the #DoFHandler# class.
- */
-class DoFLevel<1> {
-  public:
-                                    /**
-                                     * Store the global indices of the degrees
-                                     * of freedom. See \Ref{DoFLevel} for
-                                     * detailed information.
-                                     */
-    vector<int> line_dofs;
-};
-
-
-
-
-/**
- * Store the indices of the degrees of freedom which are located on quads.
- * See \Ref{DoFLevel<1>} for more information.
- */
-class DoFLevel<2> : public DoFLevel<1> {
-  public:
-                                    /**
-                                     * Store the global indices of the degrees
-                                     * of freedom. See \Ref{DoFLevel} for
-                                     * detailed information.
-                                     */
-    vector<int> quad_dofs;
-};
 
 
 
diff --git a/deal.II/deal.II/include/dofs/dof_levels.h b/deal.II/deal.II/include/dofs/dof_levels.h
new file mode 100644 (file)
index 0000000..013d058
--- /dev/null
@@ -0,0 +1,98 @@
+/*----------------------------   dof_levels.h     ---------------------------*/
+/*      $Id$                 */
+#ifndef __dof_levels_H
+#define __dof_levels_H
+/*----------------------------   dof_levels.h     ---------------------------*/
+
+
+
+#include <vector>
+
+
+/**
+ * Store the indices of the degrees of freedom which are located on the lines.
+ * Declare it to have a template parameter, but do not actually declare
+ * other types than those explicitely instantiated.
+ */
+template <int N>
+class DoFLevel;
+
+
+
+
+
+/**
+ * Store the indices of the degrees of freedom which are located on the lines.
+ *
+ * \subsection{Information for all #DoFLevel# classes}
+ *
+ * The #DoFLevel<N># classes 
+ * store the global indices of the degrees of freedom for each cell on a
+ * certain level. The index or number of a degree of freedom is the zero-based
+ * index of the according value in the solution vector and the row and column
+ * index in the global matrix or the multigrid matrix for this level. These
+ * indices refer to the unconstrained vectors and matrices, where we have not
+ * taken account of the constraints introduced by hanging nodes. If more than
+ * one value corresponds to one basis function, for example for vector equations
+ * where the solution is vector valued and thus has several degrees of freedom
+ * for each basis function, we nonetheless store only one index. This can then
+ * be viewed as the index into a block vector, where each block contains the
+ * different values according to a degree of freedom. It is left to the derived
+ * classes, whether the values in a block are stored consecutively or distributed
+ * (e.g. if the solution function is $u=(u_1, u_2)$, we could store the values
+ * in the solution vector like
+ * $\ldots, u_1^m, u_2^m, u_1^{m+1}, u_2^{m+1},\ldots$ with $m$ denoting the
+ * $m$th basis function, or $\ldots, u_1^m, u_1^{m+1}, u_1^{m+2}, \ldots,
+ * u_2^m, u_2^{m+1}, u_2^{m+2}, \ldots$, respectively). Likewise, the
+ * constraint matrix returned by #DoFHandler::make_constraint_matrix ()# is then
+ * to be understood as a block matrix.
+ *
+ * The storage format of the degrees of freedom indices (short: DoF indices) is
+ * somewhat like a mirror of the data structures of the triangulation classes.
+ * There is a hierarchy of #DoFLevel<dim># classes for the different dimensions
+ * which have objects named #line_dofs#, #quad_dofs# and so on, in which the
+ * indices of DoFs located on lines and quads, respectively, are stored. The
+ * indices are stored levelwise. The layout in
+ * these arrays is as follows: if for a selected finite element (use
+ * #DoFHandler::distribute_dofs()# to select a finite element) the number of
+ * DoFs on each line (without those in the vertices) is #N#, then the length
+ * of the #line_dofs# array is #N# times the number of lines on this level. The
+ * DoF indices for the #i#th line are at the positions #N*i...(N+1)*i-1#.
+ *
+ * The DoF indices for vertices are not stored this way, since they need
+ * different treatment in multigrid environments. If no multigrid is used, the
+ * indices are stored in the #vertex_dofs# array of the #DoFHandler# class.
+ */
+class DoFLevel<1> {
+  public:
+                                    /**
+                                     * Store the global indices of the degrees
+                                     * of freedom. See \Ref{DoFLevel} for
+                                     * detailed information.
+                                     */
+    vector<int> line_dofs;
+};
+
+
+
+
+/**
+ * Store the indices of the degrees of freedom which are located on quads.
+ * See \Ref{DoFLevel<1>} for more information.
+ */
+class DoFLevel<2> : public DoFLevel<1> {
+  public:
+                                    /**
+                                     * Store the global indices of the degrees
+                                     * of freedom. See \Ref{DoFLevel} for
+                                     * detailed information.
+                                     */
+    vector<int> quad_dofs;
+};
+
+
+
+/*----------------------------   dof_levels.h     ---------------------------*/
+/* end of #ifndef __dof_levels_H */
+#endif
+/*----------------------------   dof_levels.h     ---------------------------*/
index 49d45b2c6b7407b0f749fd52ef82ee433bbbc86c..12793da09a8445f6a76d65c401620df24aaa1756 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <grid/dof_accessor.h>
 #include <grid/dof.h>
+#include <grid/dof_levels.h>
 #include <grid/tria_iterator.h>
 #include <grid/tria_iterator.templates.h>
 #include <fe/fe.h>
index 9776cdd83e524f4f4f9e0eb217da8e7bc25cbd67..e92cb404177707e4ff426f75bbbd890c1d81e23d 100644 (file)
@@ -1,6 +1,7 @@
 /* $Id$ */
 
 #include <grid/dof.h>
+#include <grid/dof_levels.h>
 #include <grid/dof_accessor.h>
 #include <grid/dof_constraints.h>
 #include <grid/tria_levels.h>

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.