From: Martin Kronbichler Date: Thu, 4 Feb 2010 11:21:42 +0000 (+0000) Subject: Update in one comment. Remove trailing whitespace. X-Git-Tag: v8.0.0~6556 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9360114e7bde3e0c7cce1cc8b4d9f8b6455acc1;p=dealii.git Update in one comment. Remove trailing whitespace. git-svn-id: https://svn.dealii.org/trunk@20491 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index 523e6a9db9..728e0e0e61 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -41,7 +41,7 @@ namespace internal { struct Implementation; } - + namespace DoFCellAccessor { struct Implementation; @@ -81,7 +81,7 @@ namespace internal * so that this class can be used to solve problems in the finite * element method formulation. * - * + * *

Distribution of indices for degrees of freedom

* * The degrees of freedom (`dofs') are distributed on the given triangulation @@ -204,18 +204,18 @@ class DoFHandler : public Subscriptor * value. */ static const unsigned int default_fe_index = 0; - + /** * Constructor. Take @p tria as the * triangulation to work on. */ - DoFHandler ( const Triangulation &tria); + DoFHandler ( const Triangulation &tria); /** * Destructor. */ virtual ~DoFHandler (); - + /** * Go through the triangulation and * distribute the degrees of freedoms @@ -257,7 +257,7 @@ class DoFHandler : public Subscriptor * time when @p distribute_dofs was called. */ virtual void clear (); - + /** * Renumber degrees of freedom based on * a list of new dof numbers for all the @@ -349,7 +349,7 @@ class DoFHandler : public Subscriptor * dimension less. */ unsigned int max_couplings_between_boundary_dofs () const; - + /** * @name Cell iterator functions */ @@ -401,7 +401,7 @@ class DoFHandler : public Subscriptor * end(). */ cell_iterator end (const unsigned int level) const; - + /** * Return a raw iterator which is the first * iterator not on level. If @p level is @@ -615,7 +615,7 @@ class DoFHandler : public Subscriptor * end(). */ line_iterator end_line (const unsigned int level) const; - + /** * Return a raw iterator which is the first * iterator not on level. If @p level is @@ -669,7 +669,7 @@ class DoFHandler : public Subscriptor * active line on level @p level. */ active_line_iterator last_active_line (const unsigned int level) const; - /*@}*/ + /*@}*/ /*---------------------------------------*/ @@ -712,7 +712,7 @@ class DoFHandler : public Subscriptor * end(). */ quad_iterator end_quad (const unsigned int level) const; - + /** * Return a raw iterator which is the first * iterator not on level. If @p level is @@ -813,7 +813,7 @@ class DoFHandler : public Subscriptor * end(). */ hex_iterator end_hex (const unsigned int level) const; - + /** * Return a raw iterator which is the first * iterator not on level. If @p level is @@ -931,7 +931,7 @@ class DoFHandler : public Subscriptor * this object. */ const Triangulation & get_tria () const; - + /** * Determine an estimate for the * memory consumption (in bytes) @@ -940,7 +940,7 @@ class DoFHandler : public Subscriptor * This function is made virtual, * since a dof handler object * might be accessed through a - * pointers to thisr base class, + * pointers to this base class, * although the actual object * might be a derived class. */ @@ -1000,7 +1000,7 @@ class DoFHandler : public Subscriptor << ", but this level is empty."); protected: - + /** * Address of the triangulation to * work on. @@ -1049,7 +1049,7 @@ class DoFHandler : public Subscriptor * Free all used memory. */ void clear_space (); - + /** * Space to store the DoF numbers * for the different @@ -1082,7 +1082,7 @@ class DoFHandler : public Subscriptor */ std::vector vertex_dofs; - /* + /** * Make accessor objects friends. */ template friend class DoFAccessor; @@ -1090,7 +1090,7 @@ class DoFHandler : public Subscriptor friend class internal::DoFAccessor::Implementation; friend class internal::DoFCellAccessor::Implementation; - friend class internal::DoFHandler::Implementation; + friend class internal::DoFHandler::Implementation; }; 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 a9e76b14d2..0ada6edcaa 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_handler.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_handler.h @@ -735,7 +735,7 @@ class MGDoFHandler : public DoFHandler * This function is made virtual, * since a dof handler object * might be accessed through a - * pointers to thisr base class, + * pointers to this base class, * although the actual object * might be a derived class. */ diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index d5c7e12a84..36c82dbba3 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -70,7 +70,7 @@ namespace internal // dealii::DoFHandler instead of // namespace internal::DoFHandler using dealii::DoFHandler; - + /** * A class with the same purpose as the similarly named class of the * Triangulation class. See there for more information. @@ -116,7 +116,7 @@ namespace internal if (neighbor->user_flag_set()) // copy dofs { - if (v==0) + if (v==0) for (unsigned int d=0; ddofs_per_vertex; ++d) cell->set_vertex_dof_index (0, d, @@ -131,13 +131,13 @@ namespace internal continue; } } - + // otherwise: create dofs newly for (unsigned int d=0; ddofs_per_vertex; ++d) cell->set_vertex_dof_index (v, d, next_free_dof++); } - + // dofs of line for (unsigned int d=0; ddofs_per_line; ++d) @@ -146,7 +146,7 @@ namespace internal // note that this cell has been // processed cell->set_user_flag (); - + return next_free_dof; } @@ -168,21 +168,21 @@ namespace internal if (cell->vertex_dof_index(vertex, 0) == DoFHandler<2,spacedim>::invalid_dof_index) for (unsigned int d=0; ddofs_per_vertex; ++d) cell->set_vertex_dof_index (vertex, d, next_free_dof++); - + // for the four sides if (dof_handler.selected_fe->dofs_per_line > 0) for (unsigned int side=0; side::faces_per_cell; ++side) { typename DoFHandler<2,spacedim>::line_iterator line = cell->line(side); - + // distribute dofs if necessary: // check whether line dof is already // numbered (check only first dof) if (line->dof_index(0) == DoFHandler<2,spacedim>::invalid_dof_index) // if not: distribute dofs for (unsigned int d=0; ddofs_per_line; ++d) - line->set_dof_index (d, next_free_dof++); + line->set_dof_index (d, next_free_dof++); } @@ -194,10 +194,10 @@ namespace internal // note that this cell has been processed cell->set_user_flag (); - + return next_free_dof; } - + template static @@ -215,21 +215,21 @@ namespace internal if (cell->vertex_dof_index(vertex, 0) == DoFHandler<3,spacedim>::invalid_dof_index) for (unsigned int d=0; ddofs_per_vertex; ++d) cell->set_vertex_dof_index (vertex, d, next_free_dof++); - + // for the lines if (dof_handler.selected_fe->dofs_per_line > 0) for (unsigned int l=0; l::lines_per_cell; ++l) { typename DoFHandler<3,spacedim>::line_iterator line = cell->line(l); - + // distribute dofs if necessary: // check whether line dof is already // numbered (check only first dof) if (line->dof_index(0) == DoFHandler<3,spacedim>::invalid_dof_index) // if not: distribute dofs for (unsigned int d=0; ddofs_per_line; ++d) - line->set_dof_index (d, next_free_dof++); + line->set_dof_index (d, next_free_dof++); } // for the quads @@ -238,14 +238,14 @@ namespace internal { typename DoFHandler<3,spacedim>::quad_iterator quad = cell->quad(q); - + // distribute dofs if necessary: // check whether quad dof is already // numbered (check only first dof) if (quad->dof_index(0) == DoFHandler<3,spacedim>::invalid_dof_index) // if not: distribute dofs for (unsigned int d=0; ddofs_per_quad; ++d) - quad->set_dof_index (d, next_free_dof++); + quad->set_dof_index (d, next_free_dof++); } @@ -258,7 +258,7 @@ namespace internal // note that this cell has been // processed cell->set_user_flag (); - + return next_free_dof; } @@ -297,15 +297,15 @@ namespace internal dof_handler.selected_fe->dofs_per_vertex) == false, ExcInternalError ()); - - for (unsigned int level=0; level::iterator i=dof_handler.levels[level]->lines.dofs.begin(); i!=dof_handler.levels[level]->lines.dofs.end(); ++i) if (*i != DoFHandler<1,spacedim>::invalid_dof_index) *i = new_numbers[*i]; } - + template @@ -337,14 +337,14 @@ namespace internal dof_handler.selected_fe->dofs_per_vertex) == false, ExcInternalError ()); - + for (std::vector::iterator i=dof_handler.faces->lines.dofs.begin(); i!=dof_handler.faces->lines.dofs.end(); ++i) if (*i != DoFHandler<2,spacedim>::invalid_dof_index) *i = new_numbers[*i]; - for (unsigned int level=0; level::iterator i=dof_handler.levels[level]->quads.dofs.begin(); @@ -384,7 +384,7 @@ namespace internal dof_handler.selected_fe->dofs_per_vertex) == false, ExcInternalError ()); - + for (std::vector::iterator i=dof_handler.faces->lines.dofs.begin(); i!=dof_handler.faces->lines.dofs.end(); ++i) @@ -395,8 +395,8 @@ namespace internal i!=dof_handler.faces->quads.dofs.end(); ++i) if (*i != DoFHandler<3,spacedim>::invalid_dof_index) *i = new_numbers[*i]; - - for (unsigned int level=0; level::iterator i=dof_handler.levels[level]->hexes.dofs.begin(); @@ -533,7 +533,7 @@ namespace internal 114*dof_handler.selected_fe->dofs_per_line + 32*dof_handler.selected_fe->dofs_per_quad; break; - + default: Assert (false, ExcNotImplemented()); max_couplings=0; @@ -547,7 +547,7 @@ namespace internal unsigned int max_couplings_between_dofs (const DoFHandler<3,spacedim> &dof_handler) { -//TODO:[?] Invent significantly better estimates than the ones in this function +//TODO:[?] Invent significantly better estimates than the ones in this function // doing the same thing here is a // rather complicated thing, compared @@ -574,13 +574,13 @@ namespace internal Assert (false, ExcNotImplemented()); max_couplings=0; } - + return std::min(max_couplings,dof_handler.n_dofs()); } /** - * Reserve enough space in the + * Reserve enough space in the * levels[] objects to store the * numbers of the degrees of freedom * needed for the given element. The @@ -591,13 +591,13 @@ namespace internal template static void reserve_space (DoFHandler<1,spacedim> &dof_handler) - { + { dof_handler.vertex_dofs .resize(dof_handler.tria->n_vertices() * dof_handler.selected_fe->dofs_per_vertex, DoFHandler<1,spacedim>::invalid_dof_index); - - for (unsigned int i=0; in_levels(); ++i) + + for (unsigned int i=0; in_levels(); ++i) { dof_handler.levels .push_back (new internal::DoFHandler::DoFLevel<1>); @@ -614,7 +614,7 @@ namespace internal } } - + template static void reserve_space (DoFHandler<2,spacedim> &dof_handler) @@ -624,7 +624,7 @@ namespace internal dof_handler.selected_fe->dofs_per_vertex, DoFHandler<2,spacedim>::invalid_dof_index); - for (unsigned int i=0; in_levels(); ++i) + for (unsigned int i=0; in_levels(); ++i) { dof_handler.levels.push_back (new internal::DoFHandler::DoFLevel<2>); @@ -646,7 +646,7 @@ namespace internal DoFHandler<2,spacedim>::invalid_dof_index); } - + template static void reserve_space (DoFHandler<3,spacedim> &dof_handler) @@ -656,7 +656,7 @@ namespace internal dof_handler.selected_fe->dofs_per_vertex, DoFHandler<3,spacedim>::invalid_dof_index); - for (unsigned int i=0; in_levels(); ++i) + for (unsigned int i=0; in_levels(); ++i) { dof_handler.levels.push_back (new internal::DoFHandler::DoFLevel<3>); @@ -671,7 +671,7 @@ namespace internal DoFHandler<3,spacedim>::invalid_dof_index); } dof_handler.faces = new internal::DoFHandler::DoFFaces<3>; - + dof_handler.faces->lines.dofs .resize (dof_handler.tria->n_raw_lines() * dof_handler.selected_fe->dofs_per_line, @@ -1332,7 +1332,7 @@ DoFHandler::begin_raw_quad (const unsigned int level) const if (tria->n_raw_quads(level) == 0) return end_quad(); - + return raw_quad_iterator (tria, level, 0, @@ -1348,11 +1348,11 @@ DoFHandler::begin_raw_quad (const unsigned int level) const 0, this); } - - + + default: Assert (false, ExcNotImplemented()); - return raw_hex_iterator(); + return raw_hex_iterator(); } } @@ -1415,7 +1415,7 @@ DoFHandler::end_quad (const unsigned int level) const quad_iterator(end_quad()) : begin_quad (level+1)); else - return quad_iterator(end_quad()); + return quad_iterator(end_quad()); } @@ -1473,7 +1473,7 @@ DoFHandler::last_raw_quad (const unsigned int level) const default: Assert (false, ExcNotImplemented()); return raw_quad_iterator(); - } + } } @@ -1564,16 +1564,16 @@ DoFHandler::begin_raw_hex (const unsigned int level) const if (tria->n_raw_hexs(level) == 0) return end_hex(); - + return raw_hex_iterator (tria, level, 0, this); } - + default: Assert (false, ExcNotImplemented()); - return raw_hex_iterator(); + return raw_hex_iterator(); } } @@ -1716,7 +1716,7 @@ DoFHandler::last_hex () const } - + template typename DoFHandler::active_hex_iterator DoFHandler::last_active_hex (const unsigned int level) const @@ -1843,7 +1843,7 @@ template unsigned int DoFHandler::n_boundary_dofs () const { Assert (selected_fe != 0, ExcNoFESelected()); - + std::set boundary_dofs; const unsigned int dofs_per_face = selected_fe->dofs_per_face; @@ -1880,7 +1880,7 @@ DoFHandler::n_boundary_dofs (const FunctionMap &boundary_indicator Assert (selected_fe != 0, ExcNoFESelected()); Assert (boundary_indicators.find(255) == boundary_indicators.end(), ExcInvalidBoundaryIndicator()); - + std::set boundary_dofs; const unsigned int dofs_per_face = selected_fe->dofs_per_face; @@ -1907,7 +1907,7 @@ DoFHandler::n_boundary_dofs (const std::set &bounda Assert (selected_fe != 0, ExcNoFESelected()); Assert (boundary_indicators.find (255) == boundary_indicators.end(), ExcInvalidBoundaryIndicator()); - + std::set boundary_dofs; const unsigned int dofs_per_face = selected_fe->dofs_per_face; @@ -1928,6 +1928,7 @@ DoFHandler::n_boundary_dofs (const std::set &bounda } + template unsigned int DoFHandler::memory_consumption () const @@ -1942,18 +1943,19 @@ DoFHandler::memory_consumption () const for (unsigned int i=0; i -void DoFHandler::distribute_dofs (const FiniteElement &ff, - const unsigned int offset) +void DoFHandler:: + distribute_dofs (const FiniteElement &ff, + const unsigned int offset) { Assert (tria->n_levels() > 0, ExcInvalidTriangulation()); - + selected_fe = &ff; // delete all levels and set them up @@ -1974,14 +1976,15 @@ void DoFHandler::distribute_dofs (const FiniteElement user_flags; tria->save_user_flags(user_flags); const_cast &>(*tria).clear_user_flags (); - - unsigned int next_free_dof = offset; + + unsigned int next_free_dof = offset; active_cell_iterator cell = begin_active(), endc = end(); - for (; cell != endc; ++cell) + for (; cell != endc; ++cell) next_free_dof - = internal::DoFHandler::Implementation::distribute_dofs_on_cell (*this, cell, next_free_dof); + = internal::DoFHandler::Implementation:: + distribute_dofs_on_cell (*this, cell, next_free_dof); used_dofs = next_free_dof; @@ -1989,7 +1992,7 @@ void DoFHandler::distribute_dofs (const FiniteElementupdate_cell_dof_indices_cache (); - + // finally restore the user flags const_cast &>(*tria).load_user_flags(user_flags); } @@ -2029,14 +2032,14 @@ renumber_dofs (const std::vector &new_numbers) } #endif - + internal::DoFHandler::Implementation::renumber_dofs (new_numbers, *this); // update the cache used for cell dof // indices for (cell_iterator cell = begin(); cell != end(); ++cell) cell->update_cell_dof_indices_cache (); - + } @@ -2099,10 +2102,10 @@ void DoFHandler::clear_space () for (unsigned int i=0; i tmp; std::swap (vertex_dofs, tmp); } 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 dd9787ff24..42570597f0 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc @@ -838,6 +838,7 @@ MGDoFHandler::MGDoFHandler (const Triangulation &tri {} + template MGDoFHandler::~MGDoFHandler () { @@ -845,6 +846,7 @@ MGDoFHandler::~MGDoFHandler () } + template unsigned int MGDoFHandler::memory_consumption() const @@ -1948,6 +1950,7 @@ set_dof_index (const unsigned int obj_level, } + template void MGDoFHandler::distribute_dofs (const FiniteElement &fe, const unsigned int offset) @@ -1991,6 +1994,8 @@ void MGDoFHandler::distribute_dofs (const FiniteElement void MGDoFHandler::clear () @@ -2004,6 +2009,7 @@ MGDoFHandler::clear () } + template unsigned int MGDoFHandler::n_dofs (const unsigned int level) const { Assert (level < mg_used_dofs.size(), ExcInvalidLevel(level)); @@ -2012,6 +2018,7 @@ unsigned int MGDoFHandler::n_dofs (const unsigned int level) const } + #if deal_II_dimension == 1 template <> @@ -2050,6 +2057,7 @@ void MGDoFHandler<1>::renumber_dofs (const unsigned int level, #endif + #if deal_II_dimension == 2 template <> @@ -2114,6 +2122,7 @@ void MGDoFHandler<2>::renumber_dofs (const unsigned int level, #endif + #if deal_II_dimension == 3 template <> @@ -2214,12 +2223,15 @@ void MGDoFHandler<3>::renumber_dofs (const unsigned int level, #endif + template void MGDoFHandler::reserve_space () { internal::MGDoFHandler::Implementation::reserve_space (*this); } + + template void MGDoFHandler::clear_space () {