From e24acf7d7ca09d6b39779f479db71f10ad8c8618 Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 30 Jul 2004 15:21:19 +0000 Subject: [PATCH] In tria.h, we use an object of type StraightBoundary to initialize a default argument for a variable of type Boundary. Both of these types are only forward declared at this point. While most compilers seem to have no problem with this, ibm's xlC does as it tries to instantiate the default arg when seeing the explicit specialization declarations of member functions further down in the file. While it may be that xlC is wrong, there is no need to be so contrived. We can just overload the set_boundary function and have one that has one and one with two arguments. git-svn-id: https://svn.dealii.org/trunk@9537 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/tria.h | 100 ++++++++++++++-------------- deal.II/deal.II/source/grid/tria.cc | 10 +++ 2 files changed, 60 insertions(+), 50 deletions(-) diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 9bdb20ca47..a821fefcf7 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -1637,62 +1637,62 @@ class Triangulation : public Subscriptor void clear (); /** - * Assign a boundary object to - * the triangulation. If a face - * with boundary number @p number - * is refined, this object is - * used to find the location of - * new vertices on the - * boundary. This will also be - * true for non-linear - * transformations of cells to - * the unit cell in shape - * function - * calculations. Multiple calls - * to this function are allowed - * to store different boundary - * curves or surfaces. + * Assign a boundary object to a certain + * part of the boundary of a the + * triangulation. If a face with boundary + * number @p number is refined, this + * object is used to find the location of + * new vertices on the boundary. It is + * also used for for non-linear (i.e.: + * non-Q1) transformations of cells to + * the unit cell in shape function + * calculations. * - * Numbers of boundary objects - * correspond to material numbers - * of faces at the boundary, for - * instance the material id in a - * UCD input file. They are not - * necessarily consecutive but - * must be in the range 0-254. - * Material IDs on boundaries are - * also called boundary indicators - * and are accessed with accessor - * functions of that name. + * Numbers of boundary objects correspond + * to material numbers of faces at the + * boundary, for instance the material id + * in a UCD input file. They are not + * necessarily consecutive but must be in + * the range 0-254. Material IDs on + * boundaries are also called boundary + * indicators and are accessed with + * accessor functions of that name. * - * The @p boundary_object is not - * copied and MUST persist until - * the triangulation is - * destroyed. Otherwise, the - * Subscriptor class will issue - * @p ExcObjectInUse. This is - * also true for triangulations - * generated from this one by - * @p copy_triangulation. + * The @p boundary_object is not copied + * and MUST persist until the + * triangulation is destroyed. This is + * also true for triangulations generated + * from this one by @p + * copy_triangulation. * - * It is possible to remove or - * replace the boundary object - * during the lifetime of a - * non-empty - * triangulation. Usually, this - * is done before the first - * refinement and is dangerous - * afterwards. Removal of a + * It is possible to remove or replace + * the boundary object during the + * lifetime of a non-empty + * triangulation. Usually, this is done + * before the first refinement and is + * dangerous afterwards. Removal of a * boundary object is done by - * set_boundary(number), which - * uses the default argument of this - * function and replaces the boundary - * approximation by a piecewise - * straight line. + * set_boundary(number), + * i.e. the function of same name but + * only one argument. This operation then + * replaces the boundary object given + * before by a straight boundary + * approximation. */ void set_boundary (const unsigned int number, - const Boundary &boundary_object = *straight_boundary); - + const Boundary &boundary_object); + + /** + * Reset those parts of the boundary with + * the given number to use a straight + * boundary approximation. This is the + * default state of a triangulation, and + * undoes assignment of a different + * boundary object by the function of + * same name and two arguments. + */ + void set_boundary (const unsigned int number); + /** * Return a constant reference to * a boundary object used for diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 9d48446535..ccb5c51619 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -122,6 +122,16 @@ Triangulation::set_boundary (const unsigned int number, } + +template +void +Triangulation::set_boundary (const unsigned int number) +{ + set_boundary (number, *straight_boundary); +} + + + template const Boundary & Triangulation::get_boundary (const unsigned int number) const -- 2.39.5