# 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) \
if test $enablemultigrid = yes ; then
echo "$ac_t""Configuring multigrid" 1>&6
+ cat >> confdefs.h <<\EOF
+#define ENABLE_MULTIGRID 1
+EOF
+
fi
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
# 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
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
fi)
if test $enablemultigrid = yes ; then
AC_MSG_RESULT(Configuring multigrid)
+ AC_DEFINE(ENABLE_MULTIGRID)
fi
AC_SUBST(enablemultigrid)
#define __deal2__dof_tools_h
-// Copyright Wolfgang Bangerth, Guido Kanschat, and others 1999
-
-
#include <lac/forward_declarations.h>
#include <vector>
const vector<bool> &select,
vector<bool> &selected_dofs);
+#ifdef ENABLE_MULTIGRID
+
/**
* Do the same thing as #extract_dofs#
* for one level of a multi-grid DoF
const vector<bool> &select,
vector<bool> &selected_dofs);
+#endif
+
/**
* Exception
*/
friend class TriaRawIterator<3,CellAccessor<3> >;
friend class DoFHandler<dim>;
+#ifdef ENABLE_MULTIGRID
friend class MGDoFHandler<dim>;
+#endif
};
const bool use_constraints = false,
const vector<unsigned int> &starting_indices = vector<unsigned int>());
+#ifdef ENABLE_MULTIGRID
/**
* Renumber the degrees of freedom
* according to the Cuthill-McKee method,
const bool reversed_numbering = false,
const vector<unsigned int> &starting_indices = vector<unsigned int> ());
+#endif
+
/**
* Sort the degrees of freedom by
* component. The numbering within
SparseMatrix<double> &matrix,
const Function<dim> *a = 0);
+#ifdef ENABLE_MULTIGRID
+
/**
* Generate Laplace matrix for a given level.
*
SparseMatrix<float>& matrix,
const Function<dim>* a = 0);
+#endif
+
/**
* Assemble the Laplace matrix and a right
* hand side vector. If no
#include <dofs/dof_handler.h>
#include <dofs/dof_constraints.h>
#include <dofs/dof_tools.h>
+#ifdef ENABLE_MULTIGRID
#include <multigrid/mg_dof_handler.h>
#include <multigrid/mg_dof_tools.h>
+#endif
#include <fe/fe.h>
#include <numerics/dof_renumbering.h>
};
+#ifdef ENABLE_MULTIGRID
+
template <int dim>
void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim> &dof_handler,
const unsigned int level,
// this is dimension specific and
// thus needs an own function
dof_handler.renumber_dofs (level, new_number);
-};
+}
+
+
+#endif // ENABLE_MULTIGRID
template <int dim>
const bool use_constraints,
const vector<unsigned int> &starting_indices);
+template
+void DoFRenumbering::component_wise (DoFHandler<deal_II_dimension> &dof_handler,
+ const vector<unsigned int> &component_order_arg);
+
+#ifdef ENABLE_MULTIGRID
+
template
void DoFRenumbering::Cuthill_McKee (MGDoFHandler<deal_II_dimension> &dof_handler,
const unsigned int level,
const bool reversed_numbering,
const vector<unsigned int> &starting_indices);
-template
-void DoFRenumbering::component_wise (DoFHandler<deal_II_dimension> &dof_handler,
- const vector<unsigned int> &component_order_arg);
+#endif
#include <dofs/dof_handler.h>
#include <dofs/dof_accessor.h>
#include <dofs/dof_constraints.h>
+
+#ifdef ENABLE_MULTIGRID
+
#include <multigrid/mg_dof_handler.h>
#include <multigrid/mg_dof_accessor.h>
+
+#endif
+
#include <fe/fe.h>
#include <fe/fe_system.h>
#include <dofs/dof_tools.h>
}
+
+#ifdef ENABLE_MULTIGRID
+
template<int dim>
void
DoFTools::extract_level_dofs(const unsigned int level,
}
}
+#endif // ENABLE_MULTIGRID
+
// explicit instantiations
#if deal_II_dimension > 1
template void DoFTools::extract_dofs(const DoFHandler<deal_II_dimension>& dof,
const vector<bool>& local_select,
vector<bool>& selected_dofs);
+
+#ifdef ENABLE_MULTIGRID
+
template void DoFTools::extract_level_dofs(unsigned int level,
const MGDoFHandler<deal_II_dimension>& dof,
const vector<bool>& local_select,
vector<bool>& selected_dofs);
+#endif
#include <dofs/dof_handler.h>
#include <grid/tria_accessor.h>
#include <dofs/dof_accessor.h>
+
+#ifdef ENABLE_MULTIGRID
+
#include <multigrid/mg_dof_handler.h>
#include <multigrid/mg_dof_accessor.h>
+
+#endif
+
#include <grid/tria_iterator.h>
#include <grid/intergrid_map.h>
// explicit instantiations
template class InterGridMap<Triangulation, deal_II_dimension>;
template class InterGridMap<DoFHandler, deal_II_dimension>;
-template class InterGridMap<MGDoFHandler, deal_II_dimension>;
+#ifdef ENABLE_MULTIGRID
+
+template class InterGridMap<MGDoFHandler, deal_II_dimension>;
+#endif
#include "testmatrix.h"
#include <lac/sparse_matrix.h>
+#include <lac/vector.h>
FDMatrix::FDMatrix(unsigned int nx, unsigned int ny)
:
s << endl;
}
+
+#ifdef ENABLE_MULTIGRID
+
FDMGTransfer::FDMGTransfer(unsigned int nx, unsigned int ny,
unsigned int nlevels)
:
matrices[from_level-1].vmult(dst,src);
}
+#endif // ENABLE_MULTIGRID
template void FDMatrix::laplacian(SparseMatrix<long double>&) const;
template void FDMatrix::laplacian(SparseMatrix<double>&) const;
#include <lac/forward_declarations.h>
#include <base/exceptions.h>
+
+#ifdef ENABLE_MULTIGRID
+
#include <multigrid/mg_base.h>
+#endif
+
/**
* Finite difference matrix on uniform grid.
* Generator for simple 5-point discretization of Laplace problem.
unsigned int ny;
};
+#ifdef ENABLE_MULTIGRID
+
/**
* Grid transfer for finite differences on uniform grid.
*/
void build_matrix(unsigned int nx, unsigned int ny,
SparsityPattern&, SparseMatrix<double>&);
};
+
+#endif // ENABLE_MULTIGRID