From fa261ea4c6934ac98ac122a70890ac536ffa79ff Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 14 Apr 1999 11:23:48 +0000 Subject: [PATCH] Add another constructor for the 1d case, since there no faces exist. Not yet implemented, though. git-svn-id: https://svn.dealii.org/trunk@1135 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/multigrid/mg_smoother.h | 20 ++++++++++++++++++- .../deal.II/include/numerics/mg_smoother.h | 20 ++++++++++++++++++- .../deal.II/source/multigrid/mg_smoother.cc | 16 +++++++++++++++ .../deal.II/source/numerics/mg_smoother.cc | 16 +++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/mg_smoother.h b/deal.II/deal.II/include/multigrid/mg_smoother.h index 6ae764fe00..2703b910cf 100644 --- a/deal.II/deal.II/include/multigrid/mg_smoother.h +++ b/deal.II/deal.II/include/multigrid/mg_smoother.h @@ -36,7 +36,25 @@ class MGSmoother : public Subscriptor public: /** - * Constructor. This one sets clobbers + * Constructor. This one collects + * the indices of the degrees of freedom + * on the interior boundaries between + * the different levels, which are + * needed by the function + * #set_zero_interior_boundaries#. + * + * Since this function is implemented + * a bit different in 1d (there are no + * faces of cells, just vertices), + * there are actually two sets of + * constructors, namely this one for 1d + * and the following one for all other + * dimensions. + */ + MGSmoother (const MGDoFHandler<1> &mg_dof); + + /** + * Constructor. This one collects * the indices of the degrees of freedom * on the interior boundaries between * the different levels, which are diff --git a/deal.II/deal.II/include/numerics/mg_smoother.h b/deal.II/deal.II/include/numerics/mg_smoother.h index 6ae764fe00..2703b910cf 100644 --- a/deal.II/deal.II/include/numerics/mg_smoother.h +++ b/deal.II/deal.II/include/numerics/mg_smoother.h @@ -36,7 +36,25 @@ class MGSmoother : public Subscriptor public: /** - * Constructor. This one sets clobbers + * Constructor. This one collects + * the indices of the degrees of freedom + * on the interior boundaries between + * the different levels, which are + * needed by the function + * #set_zero_interior_boundaries#. + * + * Since this function is implemented + * a bit different in 1d (there are no + * faces of cells, just vertices), + * there are actually two sets of + * constructors, namely this one for 1d + * and the following one for all other + * dimensions. + */ + MGSmoother (const MGDoFHandler<1> &mg_dof); + + /** + * Constructor. This one collects * the indices of the degrees of freedom * on the interior boundaries between * the different levels, which are diff --git a/deal.II/deal.II/source/multigrid/mg_smoother.cc b/deal.II/deal.II/source/multigrid/mg_smoother.cc index b415f18743..bc6a227a85 100644 --- a/deal.II/deal.II/source/multigrid/mg_smoother.cc +++ b/deal.II/deal.II/source/multigrid/mg_smoother.cc @@ -11,7 +11,17 @@ #include +#if deal_II_dimension == 1 +MGSmoother::MGSmoother (const MGDoFHandler<1> &/*mg_dof*/) +{ + Assert (false, ExcNotImplemented()); +}; + +#endif + + +#if deal_II_dimension > 1 template MGSmoother::MGSmoother (const MGDoFHandler &mg_dof) @@ -71,6 +81,8 @@ MGSmoother::MGSmoother (const MGDoFHandler &mg_dof) }; }; +#endif + MGSmoother::~MGSmoother () @@ -104,4 +116,8 @@ MGSmoother::post_smooth (const unsigned int level, // explicit instantiations +// don't do the following instantiation in 1d, since there is a specialized +// function there +#if deal_II_dimension > 1 template MGSmoother::MGSmoother (const MGDoFHandler&); +#endif diff --git a/deal.II/deal.II/source/numerics/mg_smoother.cc b/deal.II/deal.II/source/numerics/mg_smoother.cc index b415f18743..bc6a227a85 100644 --- a/deal.II/deal.II/source/numerics/mg_smoother.cc +++ b/deal.II/deal.II/source/numerics/mg_smoother.cc @@ -11,7 +11,17 @@ #include +#if deal_II_dimension == 1 +MGSmoother::MGSmoother (const MGDoFHandler<1> &/*mg_dof*/) +{ + Assert (false, ExcNotImplemented()); +}; + +#endif + + +#if deal_II_dimension > 1 template MGSmoother::MGSmoother (const MGDoFHandler &mg_dof) @@ -71,6 +81,8 @@ MGSmoother::MGSmoother (const MGDoFHandler &mg_dof) }; }; +#endif + MGSmoother::~MGSmoother () @@ -104,4 +116,8 @@ MGSmoother::post_smooth (const unsigned int level, // explicit instantiations +// don't do the following instantiation in 1d, since there is a specialized +// function there +#if deal_II_dimension > 1 template MGSmoother::MGSmoother (const MGDoFHandler&); +#endif -- 2.39.5