]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Offset with dofs
authorcvs <cvs@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 11 Oct 1999 23:35:39 +0000 (23:35 +0000)
committercvs <cvs@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 11 Oct 1999 23:35:39 +0000 (23:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@1758 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/include/dofs/mg_dof_handler.h
deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/include/multigrid/mg_dof_handler.h
deal.II/deal.II/source/dofs/dof_handler.cc
deal.II/deal.II/source/dofs/dof_renumbering.cc
deal.II/deal.II/source/dofs/mg_dof_handler.cc
deal.II/deal.II/source/multigrid/mg_dof_handler.cc

index 53f69879cd67aff775fbe52caa448243d688c671..d0c85d98252b85805e1c29baa4214ef72eaf886e 100644 (file)
@@ -345,6 +345,11 @@ class DoFHandler  :  public Subscriptor,
                                      * according to the given distribution
                                      * method.
                                      *
+                                     * The additional optional parameter #offset#
+                                     * allows you to reserve space for a finite number
+                                     * of additional vector entries in the beginning
+                                     * of all discretization vectors.
+                                     *
                                      * A pointer of the transferred finite
                                      * element is stored. Therefore, the
                                      * lifetime of the finite element object
@@ -360,7 +365,8 @@ class DoFHandler  :  public Subscriptor,
                                      * don't need them after calling this
                                      * function, or if so store them.
                                      */
-    virtual void distribute_dofs (const FiniteElement<dim> &);
+    virtual void distribute_dofs (const FiniteElement<dim> &,
+                                 unsigned int offset = 0);
 
                                     /**
                                      * Clear all data of this object and
index 1e9cc35e69594849de914b2469d661dbb1c57e73..db852371c7052a419961e55254a3070b702a8f72 100644 (file)
@@ -174,7 +174,7 @@ class MGDoFHandler
                                      * don't need them after calling this
                                      * function, or if so store them.
                                      */
-    virtual void distribute_dofs (const FiniteElement<dim> &);
+    virtual void distribute_dofs (const FiniteElement<dim> &, unsigned int offset=0);
 
                                     /**
                                      * Actually do the renumbering based on
index 6405191c32cc236f9f6bb940136664e5e33a0901..92bd59d28cb04eceac7dddc1fc9eba11d37c7c22 100644 (file)
@@ -14,7 +14,6 @@
 //#include <grid/tria_boundary.h>
 #include <base/subscriptor.h>
 
-
 /**
  * Declare some symbolic names for mesh smoothing algorithms. The meaning of
  * these flags is documented in the #Triangulation# class.
index 1e9cc35e69594849de914b2469d661dbb1c57e73..db852371c7052a419961e55254a3070b702a8f72 100644 (file)
@@ -174,7 +174,7 @@ class MGDoFHandler
                                      * don't need them after calling this
                                      * function, or if so store them.
                                      */
-    virtual void distribute_dofs (const FiniteElement<dim> &);
+    virtual void distribute_dofs (const FiniteElement<dim> &, unsigned int offset=0);
 
                                     /**
                                      * Actually do the renumbering based on
index 1946e2511f44d313fc587f9a21a953b73f630ab8..25086213dd81487178f6ff745fc61c7807e918fa 100644 (file)
@@ -1366,7 +1366,9 @@ const Triangulation<dim> & DoFHandler<dim>::get_tria () const {
 
 
 template <int dim>
-void DoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &ff) {
+void DoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &ff,
+                                      unsigned int offset)
+{
   Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
   
   selected_fe = &ff;
@@ -1377,7 +1379,7 @@ void DoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &ff) {
                                   // need them
   tria->clear_user_flags ();
   
-  unsigned int next_free_dof = 0;   
+  unsigned int next_free_dof = offset;   
   active_cell_iterator cell = begin_active(),
                       endc = end();
 
index dfeaf76f9460dbbcd2336c8721f3995834136a02..da1eb6f1458aa43c1c6995defe1a7fd1a1c7a689 100644 (file)
@@ -182,6 +182,8 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
       last_round_dofs = next_round_dofs;
     };
 
+//TODO: Allow incomplete renumbering for non-discretization values
+
 #ifdef DEBUG
                                   //  test for all indices numbered
   if (find (new_number.begin(), new_number.end(), -1) != new_number.end())
index 5f7961248dac271a053e220ed9bb5fc824220514..9d2763f25faf94f7b437d9e9b6d631c1aa1d3a75 100644 (file)
@@ -1331,9 +1331,11 @@ MGDoFHandler<dim>::last_active_hex () const {
 
 
 template <int dim>
-void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe) {
+void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe,
+                                        unsigned int offset)
+{
                                   // first distribute global dofs
-  DoFHandler<dim>::distribute_dofs (fe);
+  DoFHandler<dim>::distribute_dofs (fe, offset);
 
 
                                   // reserve space for the MG dof numbers
@@ -1348,7 +1350,7 @@ void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe) {
                                   // separately
   for (unsigned int level=0; level<tria->n_levels(); ++level)
     {
-      unsigned int next_free_dof = 0;   
+      unsigned int next_free_dof = offset;
       cell_iterator cell = begin(level),
                    endc = end(level);
 
index 5f7961248dac271a053e220ed9bb5fc824220514..9d2763f25faf94f7b437d9e9b6d631c1aa1d3a75 100644 (file)
@@ -1331,9 +1331,11 @@ MGDoFHandler<dim>::last_active_hex () const {
 
 
 template <int dim>
-void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe) {
+void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe,
+                                        unsigned int offset)
+{
                                   // first distribute global dofs
-  DoFHandler<dim>::distribute_dofs (fe);
+  DoFHandler<dim>::distribute_dofs (fe, offset);
 
 
                                   // reserve space for the MG dof numbers
@@ -1348,7 +1350,7 @@ void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe) {
                                   // separately
   for (unsigned int level=0; level<tria->n_levels(); ++level)
     {
-      unsigned int next_free_dof = 0;   
+      unsigned int next_free_dof = offset;
       cell_iterator cell = begin(level),
                    endc = end(level);
 

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.