From 3fe3046fe67b0695fdfcaddcc5e3747bc6738764 Mon Sep 17 00:00:00 2001 From: guido Date: Tue, 4 Apr 2000 16:31:44 +0000 Subject: [PATCH] library compiles without MG git-svn-id: https://svn.dealii.org/branches/Branch-3-0@2675 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/Make.global_options.in | 4 ++-- deal.II/configure | 10 +++++++--- deal.II/configure.in | 1 + deal.II/deal.II/include/dofs/dof_tools.h | 7 ++++--- deal.II/deal.II/include/grid/tria.h | 2 ++ .../include/numerics/dof_renumbering.h | 3 +++ deal.II/deal.II/include/numerics/matrices.h | 4 ++++ .../deal.II/source/dofs/dof_renumbering.cc | 19 +++++++++++++++---- deal.II/deal.II/source/dofs/dof_tools.cc | 15 +++++++++++++++ deal.II/deal.II/source/grid/intergrid_map.cc | 11 ++++++++++- tests/lac/testmatrix.cc | 5 +++++ tests/lac/testmatrix.h | 9 +++++++++ 12 files changed, 77 insertions(+), 13 deletions(-) diff --git a/deal.II/common/Make.global_options.in b/deal.II/common/Make.global_options.in index 1ccf90f09c..a72e79d4ae 100644 --- a/deal.II/common/Make.global_options.in +++ b/deal.II/common/Make.global_options.in @@ -80,12 +80,12 @@ INCLUDE += $(addprefix -I, $(include-path-base) \ # compiler flags for debug and optimized mode -CXXFLAGS.g = -DDEBUG -ggdb -Wall -W -Wconversion \ +CXXFLAGS.g = @DEFS@ -DDEBUG -ggdb -Wall -W -Wconversion \ -Winline -Woverloaded-virtual\ -ftemplate-depth-32\ $(INCLUDE) \ $(LIBPATH) -CXXFLAGS.o = -O2 -Wuninitialized \ +CXXFLAGS.o = @DEFS@ -O2 -Wuninitialized \ -felide-constructors -fnonnull-objects \ -ftemplate-depth-32 \ $(INCLUDE) \ diff --git a/deal.II/configure b/deal.II/configure index 46eeb1a203..ca9fd782fc 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1116,6 +1116,10 @@ fi if test $enablemultigrid = yes ; then echo "$ac_t""Configuring multigrid" 1>&6 + cat >> confdefs.h <<\EOF +#define ENABLE_MULTIGRID 1 +EOF + fi @@ -1132,7 +1136,7 @@ else fi echo $ac_n "checking for kdoc""... $ac_c" 1>&6 -echo "configure:1136: checking for kdoc" >&5 +echo "configure:1140: checking for kdoc" >&5 if test -r $kdocdir/kdoc ; then echo "$ac_t""found" 1>&6 else @@ -1161,7 +1165,7 @@ if test "$docxx" = to-be-determined ; then # Extract the first word of ""doc++"", so it can be a program name with args. set dummy "doc++"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1165: checking for $ac_word" >&5 +echo "configure:1169: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_docxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1195,7 +1199,7 @@ fi else echo $ac_n "checking for doc++""... $ac_c" 1>&6 -echo "configure:1199: checking for doc++" >&5 +echo "configure:1203: checking for doc++" >&5 if test -x "$docxx" ; then echo "$ac_t""yes" 1>&6 else diff --git a/deal.II/configure.in b/deal.II/configure.in index 5a39ddba3b..9f13ff83b1 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -146,6 +146,7 @@ AC_ARG_ENABLE(multigrid, fi) if test $enablemultigrid = yes ; then AC_MSG_RESULT(Configuring multigrid) + AC_DEFINE(ENABLE_MULTIGRID) fi AC_SUBST(enablemultigrid) diff --git a/deal.II/deal.II/include/dofs/dof_tools.h b/deal.II/deal.II/include/dofs/dof_tools.h index 5bcb95a0a4..34e1c9724b 100644 --- a/deal.II/deal.II/include/dofs/dof_tools.h +++ b/deal.II/deal.II/include/dofs/dof_tools.h @@ -14,9 +14,6 @@ #define __deal2__dof_tools_h -// Copyright Wolfgang Bangerth, Guido Kanschat, and others 1999 - - #include #include @@ -358,6 +355,8 @@ class DoFTools const vector &select, vector &selected_dofs); +#ifdef ENABLE_MULTIGRID + /** * Do the same thing as #extract_dofs# * for one level of a multi-grid DoF @@ -369,6 +368,8 @@ class DoFTools const vector &select, vector &selected_dofs); +#endif + /** * Exception */ diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 90e769c8e4..fcca529e2d 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -3202,7 +3202,9 @@ class Triangulation : public TriaDimensionInfo, friend class TriaRawIterator<3,CellAccessor<3> >; friend class DoFHandler; +#ifdef ENABLE_MULTIGRID friend class MGDoFHandler; +#endif }; diff --git a/deal.II/deal.II/include/numerics/dof_renumbering.h b/deal.II/deal.II/include/numerics/dof_renumbering.h index 6cfc780663..bcddc951d3 100644 --- a/deal.II/deal.II/include/numerics/dof_renumbering.h +++ b/deal.II/deal.II/include/numerics/dof_renumbering.h @@ -183,6 +183,7 @@ class DoFRenumbering const bool use_constraints = false, const vector &starting_indices = vector()); +#ifdef ENABLE_MULTIGRID /** * Renumber the degrees of freedom * according to the Cuthill-McKee method, @@ -208,6 +209,8 @@ class DoFRenumbering const bool reversed_numbering = false, const vector &starting_indices = vector ()); +#endif + /** * Sort the degrees of freedom by * component. The numbering within diff --git a/deal.II/deal.II/include/numerics/matrices.h b/deal.II/deal.II/include/numerics/matrices.h index 37c761551a..2351d49ba9 100644 --- a/deal.II/deal.II/include/numerics/matrices.h +++ b/deal.II/deal.II/include/numerics/matrices.h @@ -288,6 +288,8 @@ class MatrixCreator SparseMatrix &matrix, const Function *a = 0); +#ifdef ENABLE_MULTIGRID + /** * Generate Laplace matrix for a given level. * @@ -300,6 +302,8 @@ class MatrixCreator SparseMatrix& matrix, const Function* a = 0); +#endif + /** * Assemble the Laplace matrix and a right * hand side vector. If no diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index 2856331c4d..4a6bc36e15 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -18,8 +18,10 @@ #include #include #include +#ifdef ENABLE_MULTIGRID #include #include +#endif #include #include @@ -237,6 +239,8 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler &dof_handler, }; +#ifdef ENABLE_MULTIGRID + template void DoFRenumbering::Cuthill_McKee (MGDoFHandler &dof_handler, const unsigned int level, @@ -398,7 +402,10 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler &dof_handler, // this is dimension specific and // thus needs an own function dof_handler.renumber_dofs (level, new_number); -}; +} + + +#endif // ENABLE_MULTIGRID template @@ -503,12 +510,16 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler &dof_handler, const bool use_constraints, const vector &starting_indices); +template +void DoFRenumbering::component_wise (DoFHandler &dof_handler, + const vector &component_order_arg); + +#ifdef ENABLE_MULTIGRID + template void DoFRenumbering::Cuthill_McKee (MGDoFHandler &dof_handler, const unsigned int level, const bool reversed_numbering, const vector &starting_indices); -template -void DoFRenumbering::component_wise (DoFHandler &dof_handler, - const vector &component_order_arg); +#endif diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 27d6282af7..450a502a86 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -17,8 +17,14 @@ #include #include #include + +#ifdef ENABLE_MULTIGRID + #include #include + +#endif + #include #include #include @@ -677,6 +683,9 @@ DoFTools::extract_dofs(const DoFHandler &dof, } + +#ifdef ENABLE_MULTIGRID + template void DoFTools::extract_level_dofs(const unsigned int level, @@ -708,6 +717,8 @@ DoFTools::extract_level_dofs(const unsigned int level, } } +#endif // ENABLE_MULTIGRID + // explicit instantiations #if deal_II_dimension > 1 @@ -750,8 +761,12 @@ DoFTools::distribute_cell_to_dof_vector (const DoFHandler &do template void DoFTools::extract_dofs(const DoFHandler& dof, const vector& local_select, vector& selected_dofs); + +#ifdef ENABLE_MULTIGRID + template void DoFTools::extract_level_dofs(unsigned int level, const MGDoFHandler& dof, const vector& local_select, vector& selected_dofs); +#endif diff --git a/deal.II/deal.II/source/grid/intergrid_map.cc b/deal.II/deal.II/source/grid/intergrid_map.cc index 64767b115c..ce99ba4e51 100644 --- a/deal.II/deal.II/source/grid/intergrid_map.cc +++ b/deal.II/deal.II/source/grid/intergrid_map.cc @@ -16,8 +16,14 @@ #include #include #include + +#ifdef ENABLE_MULTIGRID + #include #include + +#endif + #include #include @@ -174,6 +180,9 @@ void InterGridMap::clear () // explicit instantiations template class InterGridMap; template class InterGridMap; -template class InterGridMap; +#ifdef ENABLE_MULTIGRID + +template class InterGridMap; +#endif diff --git a/tests/lac/testmatrix.cc b/tests/lac/testmatrix.cc index 77d38427dd..1f9dc2363b 100644 --- a/tests/lac/testmatrix.cc +++ b/tests/lac/testmatrix.cc @@ -14,6 +14,7 @@ #include "testmatrix.h" #include +#include FDMatrix::FDMatrix(unsigned int nx, unsigned int ny) : @@ -107,6 +108,9 @@ FDMatrix::gnuplot_print(ostream& s, const Vector& V) const s << endl; } + +#ifdef ENABLE_MULTIGRID + FDMGTransfer::FDMGTransfer(unsigned int nx, unsigned int ny, unsigned int nlevels) : @@ -243,6 +247,7 @@ FDMGTransfer::restrict_and_add (const unsigned int from_level, matrices[from_level-1].vmult(dst,src); } +#endif // ENABLE_MULTIGRID template void FDMatrix::laplacian(SparseMatrix&) const; template void FDMatrix::laplacian(SparseMatrix&) const; diff --git a/tests/lac/testmatrix.h b/tests/lac/testmatrix.h index 5c1b392b77..e25e072750 100644 --- a/tests/lac/testmatrix.h +++ b/tests/lac/testmatrix.h @@ -2,8 +2,13 @@ #include #include + +#ifdef ENABLE_MULTIGRID + #include +#endif + /** * Finite difference matrix on uniform grid. * Generator for simple 5-point discretization of Laplace problem. @@ -43,6 +48,8 @@ class FDMatrix unsigned int ny; }; +#ifdef ENABLE_MULTIGRID + /** * Grid transfer for finite differences on uniform grid. */ @@ -103,3 +110,5 @@ class FDMGTransfer void build_matrix(unsigned int nx, unsigned int ny, SparsityPattern&, SparseMatrix&); }; + +#endif // ENABLE_MULTIGRID -- 2.39.5