From 321958a848f1815546f783cd4984e39487f0162b Mon Sep 17 00:00:00 2001 From: cvs Date: Mon, 11 Oct 1999 23:35:39 +0000 Subject: [PATCH] Offset with dofs git-svn-id: https://svn.dealii.org/trunk@1758 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_handler.h | 8 +++++++- deal.II/deal.II/include/dofs/mg_dof_handler.h | 2 +- deal.II/deal.II/include/grid/tria.h | 1 - deal.II/deal.II/include/multigrid/mg_dof_handler.h | 2 +- deal.II/deal.II/source/dofs/dof_handler.cc | 6 ++++-- deal.II/deal.II/source/dofs/dof_renumbering.cc | 2 ++ deal.II/deal.II/source/dofs/mg_dof_handler.cc | 8 +++++--- deal.II/deal.II/source/multigrid/mg_dof_handler.cc | 8 +++++--- 8 files changed, 25 insertions(+), 12 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index 53f69879cd..d0c85d9825 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -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 &); + virtual void distribute_dofs (const FiniteElement &, + unsigned int offset = 0); /** * Clear all data of this object and diff --git a/deal.II/deal.II/include/dofs/mg_dof_handler.h b/deal.II/deal.II/include/dofs/mg_dof_handler.h index 1e9cc35e69..db852371c7 100644 --- a/deal.II/deal.II/include/dofs/mg_dof_handler.h +++ b/deal.II/deal.II/include/dofs/mg_dof_handler.h @@ -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 &); + virtual void distribute_dofs (const FiniteElement &, unsigned int offset=0); /** * Actually do the renumbering based on diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 6405191c32..92bd59d28c 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -14,7 +14,6 @@ //#include #include - /** * Declare some symbolic names for mesh smoothing algorithms. The meaning of * these flags is documented in the #Triangulation# class. diff --git a/deal.II/deal.II/include/multigrid/mg_dof_handler.h b/deal.II/deal.II/include/multigrid/mg_dof_handler.h index 1e9cc35e69..db852371c7 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_handler.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_handler.h @@ -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 &); + virtual void distribute_dofs (const FiniteElement &, unsigned int offset=0); /** * Actually do the renumbering based on diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index 1946e2511f..25086213dd 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -1366,7 +1366,9 @@ const Triangulation & DoFHandler::get_tria () const { template -void DoFHandler::distribute_dofs (const FiniteElement &ff) { +void DoFHandler::distribute_dofs (const FiniteElement &ff, + unsigned int offset) +{ Assert (tria->n_levels() > 0, ExcInvalidTriangulation()); selected_fe = &ff; @@ -1377,7 +1379,7 @@ void DoFHandler::distribute_dofs (const FiniteElement &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(); diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index dfeaf76f94..da1eb6f145 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -182,6 +182,8 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler &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()) diff --git a/deal.II/deal.II/source/dofs/mg_dof_handler.cc b/deal.II/deal.II/source/dofs/mg_dof_handler.cc index 5f7961248d..9d2763f25f 100644 --- a/deal.II/deal.II/source/dofs/mg_dof_handler.cc +++ b/deal.II/deal.II/source/dofs/mg_dof_handler.cc @@ -1331,9 +1331,11 @@ MGDoFHandler::last_active_hex () const { template -void MGDoFHandler::distribute_dofs (const FiniteElement &fe) { +void MGDoFHandler::distribute_dofs (const FiniteElement &fe, + unsigned int offset) +{ // first distribute global dofs - DoFHandler::distribute_dofs (fe); + DoFHandler::distribute_dofs (fe, offset); // reserve space for the MG dof numbers @@ -1348,7 +1350,7 @@ void MGDoFHandler::distribute_dofs (const FiniteElement &fe) { // separately for (unsigned int level=0; leveln_levels(); ++level) { - unsigned int next_free_dof = 0; + unsigned int next_free_dof = offset; cell_iterator cell = begin(level), endc = end(level); diff --git a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc index 5f7961248d..9d2763f25f 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc @@ -1331,9 +1331,11 @@ MGDoFHandler::last_active_hex () const { template -void MGDoFHandler::distribute_dofs (const FiniteElement &fe) { +void MGDoFHandler::distribute_dofs (const FiniteElement &fe, + unsigned int offset) +{ // first distribute global dofs - DoFHandler::distribute_dofs (fe); + DoFHandler::distribute_dofs (fe, offset); // reserve space for the MG dof numbers @@ -1348,7 +1350,7 @@ void MGDoFHandler::distribute_dofs (const FiniteElement &fe) { // separately for (unsigned int level=0; leveln_levels(); ++level) { - unsigned int next_free_dof = 0; + unsigned int next_free_dof = offset; cell_iterator cell = begin(level), endc = end(level); -- 2.39.5