// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <base/smartpointer.h>
#include <lac/vector.h>
+
DEAL_II_NAMESPACE_OPEN
+
+template <int, int> class MGDoFHandler;
+template <typename> class MGLevelObject;
+
+
+namespace internal
+{
+ namespace mg
+ {
+ /**
+ * Ajust vectors on all levels to
+ * correct size. Here, we just
+ * count the numbers of degrees
+ * of freedom on each level and
+ * @p reinit each level vector
+ * to this length.
+ */
+ template <int dim, typename number, int spacedim>
+ static void
+ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<dealii::Vector<number> > &vector);
+
+ /**
+ * Ajust vectors on all levels to
+ * correct size. Here, we just
+ * count the numbers of degrees
+ * of freedom on each level and
+ * @p reinit each level vector
+ * to this length.
+ */
+ template <int dim, typename number, int spacedim>
+ static void
+ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<BlockVector<number> > &vector);
+
+
+ /**
+ * Adjust vectors on all levels
+ * to correct size. The degrees
+ * of freedom on each level are
+ * counted by block and only the
+ * block selected is used.
+ */
+ template <int dim, typename number, int spacedim>
+ static void
+ reinit_vector_by_blocks (
+ const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<dealii::Vector<number> > &v,
+ const unsigned int selected,
+ std::vector<std::vector<unsigned int> >& cached_sizes);
+
+ /**
+ * Adjust block vectors on all
+ * levels to correct size. The
+ * degrees of freedom on each
+ * level are counted by block.
+ */
+ template <int dim, typename number, int spacedim>
+ static void
+ reinit_vector_by_blocks (
+ const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<BlockVector<number> > &v,
+ const std::vector<bool> &selected,
+ std::vector<std::vector<unsigned int> >& cached_sizes);
+
+ /**
+ * Adjust block-vectors on all
+ * levels to correct size. Count
+ * the numbers of degrees of
+ * freedom on each level
+ * component-wise. Then, assign
+ * each block of @p vector the
+ * corresponding size.
+ *
+ * The boolean field @p selected
+ * allows restricting this
+ * operation to certain
+ * components. In this case, @p
+ * vector will only have as many
+ * blocks as there are true
+ * values in @p selected (no
+ * blocks of length zero are
+ * padded in). If this argument
+ * is omitted, all blocks will be
+ * considered.
+ *
+ * Degrees of freedom must be
+ * sorted by component in order
+ * to obtain reasonable results
+ * from this function.
+ *
+ * The argument
+ * @p target_component allows to
+ * re-sort and group components
+ * as in
+ * DoFRenumbering::component_wise.
+ *
+ *
+ */
+ template <int dim, typename number, int spacedim>
+ static void
+ reinit_vector_by_components (const dealii::MGDoFHandler<dim,spacedim>& mg_dof,
+ MGLevelObject<BlockVector<number> >& v,
+ const std::vector<bool>& selected,
+ const std::vector<unsigned int>& target_component,
+ std::vector<std::vector<unsigned int> >& cached_sizes);
+ /**
+ * Adjust vectors on all levels
+ * to correct size. Count the
+ * numbers of degrees of freedom
+ * on each level component-wise
+ * in a single component. Then,
+ * assign @p vector the
+ * corresponding size.
+ *
+ * The boolean field @p selected
+ * may be nonzero in a single
+ * component, indicating the
+ * block of a block vector the
+ * argument @p v corresponds to.
+ *
+ * Degrees of freedom must be
+ * sorted by component in order
+ * to obtain reasonable results
+ * from this function.
+ *
+ * The argument
+ * @p target_component allows to
+ * re-sort and group components
+ * as in
+ * DoFRenumbering::component_wise.
+ */
+ template <int dim, typename number, int spacedim>
+ static void
+ reinit_vector_by_components (
+ const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<dealii::Vector<number> > &v,
+ const std::vector<bool> &selected,
+ const std::vector<unsigned int> &target_component,
+ std::vector<std::vector<unsigned int> >& cached_sizes);
+
+ }
+}
+
+
+
/*!@addtogroup mg */
/*@{*/
* Release matrices.
*/
virtual void clear() = 0;
-
+
/**
* Smoothing function. This is the
* function used in multigrid
*/
virtual void smooth (const unsigned int level,
VECTOR& u,
- const VECTOR& rhs) const = 0;
+ const VECTOR& rhs) const = 0;
};
/*@}*/
BlockSparseMatrix<number>& matrix,
const bool preserve_symmetry);
- /**
- * Ajust vectors on all levels to
- * correct size. Here, we just
- * count the numbers of degrees
- * of freedom on each level and
- * @p reinit each level vector
- * to this length.
- */
- template <int dim, typename number, int spacedim>
- static void
- reinit_vector (const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<Vector<number> > &vector);
-
- /**
- * Ajust vectors on all levels to
- * correct size. Here, we just
- * count the numbers of degrees
- * of freedom on each level and
- * @p reinit each level vector
- * to this length.
- */
- template <int dim, typename number, int spacedim>
- static void
- reinit_vector (const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<BlockVector<number> > &vector);
-
-
- /**
- * Adjust vectors on all levels
- * to correct size. The degrees
- * of freedom on each level are
- * counted by block and only the
- * block selected is used.
- */
- template <int dim, typename number, int spacedim>
- static void
- reinit_vector_by_blocks (
- const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<Vector<number> > &v,
- const unsigned int selected,
- std::vector<std::vector<unsigned int> >& cached_sizes);
-
- /**
- * Adjust block vectors on all
- * levels to correct size. The
- * degrees of freedom on each
- * level are counted by block.
- */
- template <int dim, typename number, int spacedim>
- static void
- reinit_vector_by_blocks (
- const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<BlockVector<number> > &v,
- const std::vector<bool> &selected,
- std::vector<std::vector<unsigned int> >& cached_sizes);
-
- /**
- * Adjust block-vectors on all
- * levels to correct size. Count
- * the numbers of degrees of
- * freedom on each level
- * component-wise. Then, assign
- * each block of @p vector the
- * corresponding size.
- *
- * The boolean field @p selected
- * allows restricting this
- * operation to certain
- * components. In this case, @p
- * vector will only have as many
- * blocks as there are true
- * values in @p selected (no
- * blocks of length zero are
- * padded in). If this argument
- * is omitted, all blocks will be
- * considered.
- *
- * Degrees of freedom must be
- * sorted by component in order
- * to obtain reasonable results
- * from this function.
- *
- * The argument
- * @p target_component allows to
- * re-sort and group components
- * as in
- * DoFRenumbering::component_wise.
- *
- *
- */
- template <int dim, typename number, int spacedim>
- static void
- reinit_vector_by_components (const MGDoFHandler<dim,spacedim>& mg_dof,
- MGLevelObject<BlockVector<number> >& v,
- const std::vector<bool>& selected,
- const std::vector<unsigned int>& target_component,
- std::vector<std::vector<unsigned int> >& cached_sizes);
- /**
- * Adjust vectors on all levels
- * to correct size. Count the
- * numbers of degrees of freedom
- * on each level component-wise
- * in a single component. Then,
- * assign @p vector the
- * corresponding size.
- *
- * The boolean field @p selected
- * may be nonzero in a single
- * component, indicating the
- * block of a block vector the
- * argument @p v corresponds to.
- *
- * Degrees of freedom must be
- * sorted by component in order
- * to obtain reasonable results
- * from this function.
- *
- * The argument
- * @p target_component allows to
- * re-sort and groupt components
- * as in
- * DoFRenumbering::component_wise.
- */
- template <int dim, typename number, int spacedim>
- static void
- reinit_vector_by_components (
- const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<Vector<number> > &v,
- const std::vector<bool> &selected,
- const std::vector<unsigned int> &target_component,
- std::vector<std::vector<unsigned int> >& cached_sizes);
-
/**
* For each level in a multigrid
// $Id$
// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
MGLevelObject<VECTOR>& dst,
const InVector& src) const
{
- MGTools::reinit_vector(mg_dof_handler, dst);
+ internal::mg::reinit_vector(mg_dof_handler, dst);
bool first = true;
for (unsigned int level=mg_dof_handler.get_tria().n_levels();level != 0;)
{
template <class VECTOR>
template <int dim, int spacedim>
void MGTransferPrebuilt<VECTOR>::find_dofs_on_refinement_edges (
- const MGDoFHandler<dim,spacedim>& mg_dof)
+ const MGDoFHandler<dim,spacedim>& mg_dof)
{
for (unsigned int level = 0; level<mg_dof.get_tria().n_levels(); ++level)
{
std::vector<bool> boundary_cell_dofs(dofs_per_cell);
const unsigned int level = cell->level();
cell->get_mg_dof_indices (local_dof_indices);
- for (unsigned int face_nr=0;
+ for (unsigned int face_nr=0;
face_nr<GeometryInfo<dim>::faces_per_cell; ++face_nr)
{
typename DoFHandler<dim>::face_iterator face = cell->face(face_nr);
if(!cell->at_boundary(face_nr))
{
//interior face
- typename MGDoFHandler<dim>::cell_iterator neighbor
+ typename MGDoFHandler<dim>::cell_iterator neighbor
= cell->neighbor(face_nr);
// Do refinement face
// from the coarse side
//---------------------------------------------------------------------------
// mg_transfer.templates.h,v 1.22 2006/01/29 15:03:55 guido Exp
-// Version:
+// Version:
//
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// Simplify some things below
typedef std::map<unsigned int, unsigned int>::const_iterator IT;
-
+
template <typename number>
MGLevelObject<Vector<number> > &dst,
const BlockVector<number2> &src) const
{
- MGTools::reinit_vector_by_blocks(mg_dof_handler, dst, selected_block, sizes);
+ internal::mg::reinit_vector_by_blocks(mg_dof_handler, dst,
+ selected_block, sizes);
// For MGTransferBlockSelect, the
// multilevel block is always the
// first, since only one block is
MGLevelObject<Vector<number> > &dst,
const Vector<number2> &src) const
{
- MGTools::reinit_vector_by_blocks(mg_dof_handler, dst, selected_block, sizes);
+ internal::mg::reinit_vector_by_blocks(mg_dof_handler, dst,
+ selected_block, sizes);
// For MGTransferBlockSelect, the
// multilevel block is always the
// first, since only one block is selected.
if (!first)
restrict_and_add (level+1, dst[level], dst[level+1]);
first = false;
- }
+ }
}
MGLevelObject<BlockVector<number> >& dst,
const BlockVector<number2>& src) const
{
- MGTools::reinit_vector_by_blocks(mg_dof_handler, dst, selected, sizes);
+ internal::mg::reinit_vector_by_blocks(mg_dof_handler, dst,
+ selected, sizes);
bool first = true;
for (unsigned int level=mg_dof_handler.get_tria().n_levels();level != 0;)
{
//---------------------------------------------------------------------------
// mg_transfer.templates.h,v 1.22 2006/01/29 15:03:55 guido Exp
-// Version:
+// Version:
//
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const unsigned int offset) const
{
const FiniteElement<dim>& fe = mg_dof_handler.get_fe();
-
+
const unsigned int dofs_per_cell = fe.dofs_per_cell;
-
+
// set the elements of the vectors
// on all levels to zero
unsigned int minlevel = dst.get_minlevel();
unsigned int maxlevel = dst.get_maxlevel();
-
+
dst=0;
-
+
Assert(sizes.size()==mg_dof_handler.get_tria().n_levels(),
ExcMatricesNotBuilt());
- MGTools::reinit_vector_by_components(
+ internal::mg::reinit_vector_by_components(
mg_dof_handler, dst, mg_selected, mg_target_component, sizes);
-
+
std::vector<unsigned int> global_dof_indices (dofs_per_cell);
std::vector<unsigned int> level_dof_indices (dofs_per_cell);
-
+
// Build a vector of the selected
// indices, since traversing all
// indices on each cell is too
= mg_component_start[level][selected_component];
const typename std::vector<unsigned int>::const_iterator
end = selected_indices.end();
-
+
for (typename std::vector<unsigned int>::const_iterator
i=selected_indices.begin();
i != end; ++i)
const unsigned int offset) const
{
const FiniteElement<dim>& fe = mg_dof_handler.get_fe();
-
+
const unsigned int dofs_per_cell = fe.dofs_per_cell;
std::vector<unsigned int> global_dof_indices (dofs_per_cell);
std::vector<unsigned int> level_dof_indices (dofs_per_cell);
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
//---------------------------------------------------------------------------
-#include <multigrid/mg_base.h>
#include <lac/vector.h>
#include <lac/block_vector.h>
+#include <fe/fe.h>
+#include <multigrid/mg_dof_handler.h>
+#include <multigrid/mg_base.h>
+#include <multigrid/mg_level_object.h>
+#include <multigrid/mg_tools.h>
+
+#include <numeric>
DEAL_II_NAMESPACE_OPEN
+namespace internal
+{
+ namespace mg
+ {
+ template <int dim, typename number, int spacedim>
+ void
+ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<dealii::Vector<number> > &v)
+ {
+ for (unsigned int level=v.get_minlevel();
+ level<=v.get_maxlevel();++level)
+ {
+ unsigned int n = mg_dof.n_dofs (level);
+ v[level].reinit(n);
+ }
+
+ }
+
+
+ template <int dim, typename number, int spacedim>
+ void
+ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<BlockVector<number> > &v)
+ {
+ const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
+ std::vector<std::vector<unsigned int> >
+ ndofs(mg_dof.get_tria().n_levels(),
+ std::vector<unsigned int>(n_blocks));
+ MGTools::count_dofs_per_block (mg_dof, ndofs);
+
+ for (unsigned int level=v.get_minlevel();
+ level<=v.get_maxlevel();++level)
+ {
+ v[level].reinit(ndofs[level]);
+ }
+ }
+
+
+ template <int dim, typename number, int spacedim>
+ void
+ reinit_vector_by_components (
+ const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<BlockVector<number> > &v,
+ const std::vector<bool> &sel,
+ const std::vector<unsigned int> &target_comp,
+ std::vector<std::vector<unsigned int> >& ndofs)
+ {
+ std::vector<bool> selected=sel;
+ std::vector<unsigned int> target_component=target_comp;
+ const unsigned int ncomp = mg_dof.get_fe().n_components();
+
+ // If the selected and
+ // target_component have size 0,
+ // they must be replaced by default
+ // values.
+ //
+ // Since we already made copies
+ // directly after this function was
+ // called, we use the arguments
+ // directly.
+ if (target_component.size() == 0)
+ {
+ target_component.resize(ncomp);
+ for (unsigned int i=0;i<ncomp;++i)
+ target_component[i] = i;
+ }
+
+ // If selected is an empty vector,
+ // all components are selected.
+ if (selected.size() == 0)
+ {
+ selected.resize(target_component.size());
+ std::fill_n (selected.begin(), ncomp, false);
+ for (unsigned int i=0;i<target_component.size();++i)
+ selected[target_component[i]] = true;
+ }
+
+ Assert (selected.size() == target_component.size(),
+ ExcDimensionMismatch(selected.size(), target_component.size()));
+
+ // Compute the number of blocks needed
+ const unsigned int n_selected
+ = std::accumulate(selected.begin(),
+ selected.end(),
+ 0U);
+
+ if (ndofs.size() == 0)
+ {
+ std::vector<std::vector<unsigned int> >
+ new_dofs(mg_dof.get_tria().n_levels(),
+ std::vector<unsigned int>(target_component.size()));
+ std::swap(ndofs, new_dofs);
+ MGTools::count_dofs_per_component (mg_dof, ndofs,
+ true, target_component);
+ }
+
+ for (unsigned int level=v.get_minlevel();
+ level<=v.get_maxlevel();++level)
+ {
+ v[level].reinit(n_selected, 0);
+ unsigned int k=0;
+ for (unsigned int i=0;i<selected.size() && (k<v[level].n_blocks());++i)
+ {
+ if (selected[i])
+ {
+ v[level].block(k++).reinit(ndofs[level][i]);
+ }
+ v[level].collect_sizes();
+ }
+ }
+ }
+
+
+ template <int dim, typename number, int spacedim>
+ void
+ reinit_vector_by_components (
+ const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<dealii::Vector<number> > &v,
+ const std::vector<bool> &selected,
+ const std::vector<unsigned int> &target_component,
+ std::vector<std::vector<unsigned int> >& ndofs)
+ {
+ Assert (selected.size() == target_component.size(),
+ ExcDimensionMismatch(selected.size(), target_component.size()));
+
+ // Compute the number of blocks needed
+#ifdef DEBUG
+ const unsigned int n_selected
+ = std::accumulate(selected.begin(),
+ selected.end(),
+ 0U);
+ Assert(n_selected == 1, ExcDimensionMismatch(n_selected, 1));
+#endif
+
+ unsigned int selected_block = 0;
+ while (!selected[selected_block])
+ ++selected_block;
+
+ if (ndofs.size() == 0)
+ {
+ std::vector<std::vector<unsigned int> >
+ new_dofs(mg_dof.get_tria().n_levels(),
+ std::vector<unsigned int>(target_component.size()));
+ std::swap(ndofs, new_dofs);
+ MGTools::count_dofs_per_component (mg_dof, ndofs,
+ true, target_component);
+ }
+
+ for (unsigned int level=v.get_minlevel();
+ level<=v.get_maxlevel();++level)
+ {
+ v[level].reinit(ndofs[level][selected_block]);
+ }
+ }
+
+
+ template <int dim, typename number, int spacedim>
+ void
+ reinit_vector_by_blocks (
+ const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<BlockVector<number> > &v,
+ const std::vector<bool> &sel,
+ std::vector<std::vector<unsigned int> >& ndofs)
+ {
+ std::vector<bool> selected=sel;
+ // Compute the number of blocks needed
+ const unsigned int n_selected
+ = std::accumulate(selected.begin(),
+ selected.end(),
+ 0U);
+
+ if (ndofs.size() == 0)
+ {
+ std::vector<std::vector<unsigned int> >
+ new_dofs(mg_dof.get_tria().n_levels(),
+ std::vector<unsigned int>(selected.size()));
+ std::swap(ndofs, new_dofs);
+ MGTools::count_dofs_per_block (mg_dof, ndofs);
+ }
+
+ for (unsigned int level=v.get_minlevel();
+ level<=v.get_maxlevel();++level)
+ {
+ v[level].reinit(n_selected, 0);
+ unsigned int k=0;
+ for (unsigned int i=0;i<selected.size() && (k<v[level].n_blocks());++i)
+ {
+ if (selected[i])
+ {
+ v[level].block(k++).reinit(ndofs[level][i]);
+ }
+ v[level].collect_sizes();
+ }
+ }
+ }
+
+
+ template <int dim, typename number, int spacedim>
+ void
+ reinit_vector_by_blocks (
+ const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
+ MGLevelObject<dealii::Vector<number> > &v,
+ const unsigned int selected_block,
+ std::vector<std::vector<unsigned int> >& ndofs)
+ {
+ const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
+ Assert(selected_block < n_blocks, ExcIndexRange(selected_block, 0, n_blocks));
+
+ std::vector<bool> selected(n_blocks, false);
+ selected[selected_block] = true;
+
+ if (ndofs.size() == 0)
+ {
+ std::vector<std::vector<unsigned int> >
+ new_dofs(mg_dof.get_tria().n_levels(),
+ std::vector<unsigned int>(selected.size()));
+ std::swap(ndofs, new_dofs);
+ MGTools::count_dofs_per_block (mg_dof, ndofs);
+ }
+
+ for (unsigned int level=v.get_minlevel();
+ level<=v.get_maxlevel();++level)
+ {
+ v[level].reinit(ndofs[level][selected_block]);
+ }
+ }
+ }
+}
+
+
+
template <class VECTOR>
MGTransferBase<VECTOR>::~MGTransferBase()
{}
// Explicit instantiations
-template class MGTransferBase<Vector<double> >;
-template class MGTransferBase<Vector<float> >;
+//TODO: Use the template expander script for this
+namespace internal
+{
+ namespace mg
+ {
+ template void reinit_vector<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<dealii::Vector<double> >&);
+ template void reinit_vector<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<dealii::Vector<float> >&);
+
+ template void reinit_vector<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<double> >&);
+ template void reinit_vector<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<float> >&);
+
+ template void reinit_vector_by_components<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<double> >&,
+ const std::vector<bool> &,
+ const std::vector<unsigned int> &,
+ std::vector<std::vector<unsigned int> >&);
+ template void reinit_vector_by_components<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<float> >&,
+ const std::vector<bool> &,
+ const std::vector<unsigned int> &,
+ std::vector<std::vector<unsigned int> >&);
+
+ template void reinit_vector_by_components<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&, MGLevelObject<dealii::Vector<double> >&,
+ const std::vector<bool>&, const std::vector<unsigned int>&,
+ std::vector<std::vector<unsigned int> >&);
+ template void reinit_vector_by_components<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&, MGLevelObject<dealii::Vector<float> >&,
+ const std::vector<bool>&, const std::vector<unsigned int>&,
+ std::vector<std::vector<unsigned int> >&);
+
+ template void reinit_vector_by_blocks<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&, MGLevelObject<BlockVector<double> >&,
+ const std::vector<bool> &, std::vector<std::vector<unsigned int> >&);
+ template void reinit_vector_by_blocks<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&, MGLevelObject<BlockVector<float> >&,
+ const std::vector<bool> &, std::vector<std::vector<unsigned int> >&);
+
+ template void reinit_vector_by_blocks<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&, MGLevelObject<dealii::Vector<double> >&,
+ unsigned int, std::vector<std::vector<unsigned int> >&);
+ template void reinit_vector_by_blocks<deal_II_dimension> (
+ const dealii::MGDoFHandler<deal_II_dimension>&, MGLevelObject<dealii::Vector<float> >&,
+ unsigned int, std::vector<std::vector<unsigned int> >&);
+ }
+}
+
+
+template class MGTransferBase<dealii::Vector<double> >;
+template class MGTransferBase<dealii::Vector<float> >;
template class MGTransferBase<BlockVector<double> >;
template class MGTransferBase<BlockVector<float> >;
-template class MGMatrixBase<Vector<double> >;
-template class MGMatrixBase<Vector<float> >;
+template class MGMatrixBase<dealii::Vector<double> >;
+template class MGMatrixBase<dealii::Vector<float> >;
template class MGMatrixBase<BlockVector<double> >;
template class MGMatrixBase<BlockVector<float> >;
-template class MGSmootherBase<Vector<float> >;
-template class MGSmootherBase<Vector<double> >;
+template class MGSmootherBase<dealii::Vector<float> >;
+template class MGSmootherBase<dealii::Vector<double> >;
template class MGSmootherBase<BlockVector<float> >;
template class MGSmootherBase<BlockVector<double> >;
-template class MGCoarseGridBase<Vector<double> >;
-template class MGCoarseGridBase<Vector<float> >;
+template class MGCoarseGridBase<dealii::Vector<double> >;
+template class MGCoarseGridBase<dealii::Vector<float> >;
template class MGCoarseGridBase<BlockVector<double> >;
template class MGCoarseGridBase<BlockVector<float> >;
const_cast<Triangulation<dim,spacedim>&> (dofs.get_tria());
user_flags_triangulation.save_user_flags(old_flags);
user_flags_triangulation.clear_user_flags();
-
+
const typename MGDoFHandler<dim,spacedim>::cell_iterator end = dofs.end(level);
typename MGDoFHandler<dim,spacedim>::active_cell_iterator cell;
std::vector<unsigned int> cell_indices;
// dofs_per_vertex is
// arbitrary, not the other way
// round.
-//TODO: This assumes that even in hp context, the dofs per face coincide!
+//TODO: This assumes that even in hp context, the dofs per face coincide!
unsigned int increment = fe.dofs_per_cell - dim * fe.dofs_per_face;
while (i < fe.first_line_index)
row_lengths[cell_indices[i++]] += increment;
// faces are handled below, we
// have to subtract ALL faces
// in this case.
-
+
// In all other cases we
// subtract adjacent faces to be
// added in the loop below.
: fe.dofs_per_cell - GeometryInfo<dim>::faces_per_cell * fe.dofs_per_face;
while (i < fe.first_quad_index)
row_lengths[cell_indices[i++]] += increment;
-
+
// Now quads in 2D and 3D
increment = (dim>2)
? fe.dofs_per_cell - (dim-2) * fe.dofs_per_face
// coupled topologically to the
// adjacent cells, but we
// subtracted some faces.
-
+
// Now, let's go by the faces
// and add the missing
// contribution as well as the
if (static_cast<unsigned int>(neighbor->level()) != level)
level_boundary = true;
}
-
+
if (level_boundary)
{
for (unsigned int i=0;i<fe.dofs_per_cell;++i)
row_lengths[cell_indices[i]] += fe.dofs_per_face;
continue;
}
-
+
const FiniteElement<dim>& nfe = neighbor->get_fe();
typename MGDoFHandler<dim,spacedim>::face_iterator face = cell->face(iface);
-
+
// Flux couplings are
// computed from both sides
// for simplicity.
-
+
// The dofs on the common face
// will be handled below,
// therefore, we subtract them
for (unsigned int i=0;i<fe.dofs_per_cell;++i)
row_lengths[cell_indices[i]] += increment;
}
-
+
// Do this only once per
// face.
if (face->user_flag_set())
// face dofs. Since we
// subtracted two faces, we
// have to re-add one.
-
+
// If one side of the face
// is refined, all the fine
// face dofs couple with
{
Assert (row_lengths.size() == dofs.n_dofs(),
ExcDimensionMismatch(row_lengths.size(), dofs.n_dofs()));
-
+
// Function starts here by
// resetting the counters.
std::fill(row_lengths.begin(), row_lengths.end(), 0);
const_cast<Triangulation<dim,spacedim>&> (dofs.get_tria());
user_flags_triangulation.save_user_flags(old_flags);
user_flags_triangulation.clear_user_flags();
-
+
const typename MGDoFHandler<dim,spacedim>::cell_iterator end = dofs.end(level);
typename MGDoFHandler<dim,spacedim>::active_cell_iterator cell;
std::vector<unsigned int> cell_indices;
std::vector<unsigned int> neighbor_indices;
-
+
// We have to translate the
// couplings from components to
// blocks, so this works for
std::vector<Table<2, DoFTools::Coupling> > couple_face;
DoFTools::convert_couplings_to_blocks(dofs, couplings, couple_cell);
DoFTools::convert_couplings_to_blocks(dofs, flux_couplings, couple_face);
-
+
// We loop over cells and go from
// cells to lower dimensional
// objects. This is the only way to
{
const FiniteElement<dim>& fe = cell->get_fe();
const unsigned int fe_index = cell->active_fe_index();
-
+
Assert (couplings.n_rows()==fe.n_components(),
ExcDimensionMismatch(couplings.n_rows(), fe.n_components()));
Assert (couplings.n_cols()==fe.n_components(),
ExcDimensionMismatch(flux_couplings.n_rows(), fe.n_components()));
Assert (flux_couplings.n_cols()==fe.n_components(),
ExcDimensionMismatch(flux_couplings.n_cols(), fe.n_components()));
-
+
cell_indices.resize(fe.dofs_per_cell);
cell->get_mg_dof_indices(cell_indices);
unsigned int i = 0;
// faces are handled below, we
// have to subtract ALL faces
// in this case.
-
+
// In all other cases we
// subtract adjacent faces to be
// added in the loop below.
}
++i;
}
-
+
// Now quads in 2D and 3D
while (i < fe.first_hex_index)
{
}
++i;
}
-
+
// Finally, cells in 3D
while (i < fe.dofs_per_cell)
{
}
++i;
}
-
+
// At this point, we have
// counted all dofs
// contributiong from cells
// coupled topologically to the
// adjacent cells, but we
// subtracted some faces.
-
+
// Now, let's go by the faces
// and add the missing
// contribution as well as the
if (static_cast<unsigned int>(neighbor->level()) != level)
level_boundary = true;
}
-
+
if (level_boundary)
{
for (unsigned int i=0;i<fe.dofs_per_cell;++i)
row_lengths[cell_indices[i]] += fe.dofs_per_face;
continue;
}
-
+
const FiniteElement<dim>& nfe = neighbor->get_fe();
typename MGDoFHandler<dim,spacedim>::face_iterator face = cell->face(iface);
-
+
// Flux couplings are
// computed from both sides
// for simplicity.
-
+
// The dofs on the common face
// will be handled below,
// therefore, we subtract them
- nfe.base_element(base).dofs_per_face;
row_lengths[cell_indices[i]] += increment;
}
-
+
// Do this only once per
// face and not on the
// hanging faces.
// face dofs. Since we
// subtracted two faces, we
// have to re-add one.
-
+
// If one side of the face
// is refined, all the fine
// face dofs couple with
// the coarse one.
-
+
// Wolfgang, do they couple
// with each other by
// constraints?
std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
typename MGDoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
endc = dof.end(level);
- for (; cell!=endc; ++cell)
+ for (; cell!=endc; ++cell)
{
cell->get_mg_dof_indices (dofs_on_this_cell);
// make sparsity pattern for this cell
const unsigned int level)
{
const unsigned int n_dofs = dof.n_dofs(level);
-
+
Assert (sparsity.n_rows() == n_dofs,
ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
Assert (sparsity.n_cols() == n_dofs,
}
}
}
- }
+ }
}
}
const unsigned int fine_dofs = dof.n_dofs(level);
const unsigned int coarse_dofs = dof.n_dofs(level-1);
-
+
// Matrix maps from fine level to coarse level
Assert (sparsity.n_rows() == coarse_dofs,
}
}
}
- }
+ }
}
}
const FiniteElement<dim>& fe = dof.get_fe();
const unsigned int n_dofs = dof.n_dofs(level);
const unsigned int n_comp = fe.n_components();
-
+
Assert (sparsity.n_rows() == n_dofs,
ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
Assert (sparsity.n_cols() == n_dofs,
ExcDimensionMismatch (flux_mask.n_rows(), n_comp));
Assert (flux_mask.n_cols() == n_comp,
ExcDimensionMismatch (flux_mask.n_cols(), n_comp));
-
+
const unsigned int total_dofs = fe.dofs_per_cell;
std::vector<unsigned int> dofs_on_this_cell(total_dofs);
std::vector<unsigned int> dofs_on_other_cell(total_dofs);
Table<2,bool> support_on_face(total_dofs, GeometryInfo<dim>::faces_per_cell);
-
+
typename MGDoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
endc = dof.end(level);
const Table<2,DoFTools::Coupling>
int_dof_mask = DoFTools::dof_couplings_from_component_couplings(fe, int_mask),
flux_dof_mask = DoFTools::dof_couplings_from_component_couplings(fe, flux_mask);
-
+
for (unsigned int i=0; i<total_dofs; ++i)
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell;++f)
support_on_face(i,f) = fe.has_support_on_face(i,f);
-
+
// Clear user flags because we will
// need them. But first we save
// them and make sure that we
std::vector<bool> user_flags;
dof.get_tria().save_user_flags(user_flags);
const_cast<Triangulation<dim,spacedim> &>(dof.get_tria()).clear_user_flags ();
-
+
for (; cell!=endc; ++cell)
{
cell->get_mg_dof_indices (dofs_on_this_cell);
for (unsigned int j=0; j<total_dofs; ++j)
{
const bool j_non_zero_i = support_on_face (j, face);
-
+
if (flux_dof_mask(i,j) == DoFTools::always)
sparsity.add (dofs_on_this_cell[i],
dofs_on_this_cell[j]);
{
typename MGDoFHandler<dim,spacedim>::cell_iterator
neighbor = cell->neighbor(face);
-
+
if (neighbor->level() < cell->level())
continue;
-
+
unsigned int neighbor_face = cell->neighbor_of_neighbor(face);
-
+
neighbor->get_mg_dof_indices (dofs_on_other_cell);
for (unsigned int i=0; i<total_dofs; ++i)
{
dofs_on_this_cell[j]);
if (i_non_zero_e && j_non_zero_e)
sparsity.add (dofs_on_other_cell[i],
- dofs_on_other_cell[j]);
+ dofs_on_other_cell[j]);
}
-
+
if (flux_dof_mask(j,i) == DoFTools::always)
{
sparsity.add (dofs_on_this_cell[j],
dofs_on_this_cell[i]);
if (j_non_zero_e && i_non_zero_e)
sparsity.add (dofs_on_other_cell[j],
- dofs_on_other_cell[i]);
+ dofs_on_other_cell[i]);
}
}
}
- neighbor->face(neighbor_face)->set_user_flag ();
+ neighbor->face(neighbor_face)->set_user_flag ();
}
}
}
-
+
// finally restore the user flags
const_cast<Triangulation<dim,spacedim> &>(dof.get_tria()).load_user_flags(user_flags);
}
{
const FiniteElement<dim>& fe = dof.get_fe();
const unsigned int n_comp = fe.n_components();
-
+
Assert ((level>=1) && (level<dof.get_tria().n_levels()),
ExcIndexRange(level, 1, dof.get_tria().n_levels()));
const unsigned int fine_dofs = dof.n_dofs(level);
const unsigned int coarse_dofs = dof.n_dofs(level-1);
-
+
// Matrix maps from fine level to coarse level
Assert (sparsity.n_rows() == coarse_dofs,
std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
std::vector<unsigned int> dofs_on_other_cell(dofs_per_cell);
Table<2,bool> support_on_face(dofs_per_cell, GeometryInfo<dim>::faces_per_cell);
-
+
typename MGDoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
endc = dof.end(level);
const Table<2,DoFTools::Coupling> flux_dof_mask
= DoFTools::dof_couplings_from_component_couplings(fe, flux_mask);
-
+
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell;++f)
support_on_face(i,f) = fe.has_support_on_face(i,f);
-
+
for (; cell!=endc; ++cell)
{
cell->get_mg_dof_indices (dofs_on_this_cell);
}
}
}
- }
+ }
}
}
const FiniteElement<dim>& fe = dof_handler.get_fe();
const unsigned int n_components = fe.n_components();
const unsigned int nlevels = dof_handler.get_tria().n_levels();
-
+
Assert (result.size() == nlevels,
ExcDimensionMismatch(result.size(), nlevels));
-
+
if (target_component.size() == 0)
{
target_component.resize(n_components);
{
result[l].resize (n_components);
std::fill (result[l].begin(),result[l].end(), 0U);
-
+
// special case for only one
// component. treat this first
// since it does not require any
const FiniteElement<dim>& base = fe.base_element(b);
// Dimension of base element
unsigned int d = base.n_components();
-
+
for (unsigned int m=0;m<fe.element_multiplicity(b);++m)
{
for (unsigned int dd=0;dd<d;++dd)
const FiniteElement<dim>& fe = dof_handler.get_fe();
const unsigned int n_blocks = fe.n_blocks();
const unsigned int n_levels = dof_handler.get_tria().n_levels();
-
+
dofs_per_block.resize (n_levels);
-
+
for (unsigned int l=0;l<n_levels;++l)
std::fill (dofs_per_block[l].begin(), dofs_per_block[l].end(), 0U);
// If the empty vector was given as
for (unsigned int i=0;i<n_blocks;++i)
target_block[i] = i;
}
- else
Assert(target_block.size()==n_blocks,
ExcDimensionMismatch(target_block.size(),n_blocks));
for (unsigned int l=0;l<n_levels;++l)
dofs_per_block[l][0] = dof_handler.n_dofs(l);
return;
- }
+ }
// otherwise determine the number
// of dofs in each block
// separately. do so in parallel
dofs_in_block[i], true);
};
tasks.join_all ();
-
+
// next count what we got
for (unsigned int block=0;block<fe.n_blocks();++block)
dofs_per_block[l][target_block[block]]
const unsigned int n_components = DoFTools::n_components(dof);
const unsigned int n_levels = dof.get_tria().n_levels();
const bool fe_is_system = (n_components != 1);
-
+
AssertDimension (boundary_indices.size(), n_levels);
-
+
// for (typename FunctionMap<dim>::type::const_iterator i=function_map.begin();
// i!=function_map.end(); ++i)
// Assert (n_components == i->second->n_components,
std::vector<unsigned int> face_dofs;
face_dofs.reserve (DoFTools::max_dofs_per_face(dof));
std::fill (face_dofs.begin (), face_dofs.end (), DoFHandler<dim>::invalid_dof_index);
-
+
typename MGDoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(),
endc = dof.end();
for (; cell!=endc; ++cell)
#endif
-
-template <int dim, typename number, int spacedim>
-void
-MGTools::reinit_vector (const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<Vector<number> > &v)
-{
- for (unsigned int level=v.get_minlevel();
- level<=v.get_maxlevel();++level)
- {
- unsigned int n = mg_dof.n_dofs (level);
- v[level].reinit(n);
- }
-
-}
-
-
-template <int dim, typename number, int spacedim>
-void
-MGTools::reinit_vector (const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<BlockVector<number> > &v)
-{
- const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
- std::vector<std::vector<unsigned int> >
- ndofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(n_blocks));
- count_dofs_per_block (mg_dof, ndofs);
-
- for (unsigned int level=v.get_minlevel();
- level<=v.get_maxlevel();++level)
- {
- v[level].reinit(ndofs[level]);
- }
-}
-
-
-template <int dim, typename number, int spacedim>
-void
-MGTools::reinit_vector_by_components (
- const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<BlockVector<number> > &v,
- const std::vector<bool> &sel,
- const std::vector<unsigned int> &target_comp,
- std::vector<std::vector<unsigned int> >& ndofs)
-{
- std::vector<bool> selected=sel;
- std::vector<unsigned int> target_component=target_comp;
- const unsigned int ncomp = mg_dof.get_fe().n_components();
-
- // If the selected and
- // target_component have size 0,
- // they must be replaced by default
- // values.
- //
- // Since we already made copies
- // directly after this function was
- // called, we use the arguments
- // directly.
- if (target_component.size() == 0)
- {
- target_component.resize(ncomp);
- for (unsigned int i=0;i<ncomp;++i)
- target_component[i] = i;
- }
-
- // If selected is an empty vector,
- // all components are selected.
- if (selected.size() == 0)
- {
- selected.resize(target_component.size());
- std::fill_n (selected.begin(), ncomp, false);
- for (unsigned int i=0;i<target_component.size();++i)
- selected[target_component[i]] = true;
- }
-
- Assert (selected.size() == target_component.size(),
- ExcDimensionMismatch(selected.size(), target_component.size()));
-
- // Compute the number of blocks needed
- const unsigned int n_selected
- = std::accumulate(selected.begin(),
- selected.end(),
- 0U);
-
- if (ndofs.size() == 0)
- {
- std::vector<std::vector<unsigned int> >
- new_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(target_component.size()));
- std::swap(ndofs, new_dofs);
- count_dofs_per_component (mg_dof, ndofs, true, target_component);
- }
-
- for (unsigned int level=v.get_minlevel();
- level<=v.get_maxlevel();++level)
- {
- v[level].reinit(n_selected, 0);
- unsigned int k=0;
- for (unsigned int i=0;i<selected.size() && (k<v[level].n_blocks());++i)
- {
- if (selected[i])
- {
- v[level].block(k++).reinit(ndofs[level][i]);
- }
- v[level].collect_sizes();
- }
- }
-}
-
-
-template <int dim, typename number, int spacedim>
-void
-MGTools::reinit_vector_by_components (
- const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<Vector<number> > &v,
- const std::vector<bool> &selected,
- const std::vector<unsigned int> &target_component,
- std::vector<std::vector<unsigned int> >& ndofs)
-{
- Assert (selected.size() == target_component.size(),
- ExcDimensionMismatch(selected.size(), target_component.size()));
-
- // Compute the number of blocks needed
-#ifdef DEBUG
- const unsigned int n_selected
- = std::accumulate(selected.begin(),
- selected.end(),
- 0U);
- Assert(n_selected == 1, ExcDimensionMismatch(n_selected, 1));
-#endif
-
- unsigned int selected_block = 0;
- while (!selected[selected_block])
- ++selected_block;
-
- if (ndofs.size() == 0)
- {
- std::vector<std::vector<unsigned int> >
- new_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(target_component.size()));
- std::swap(ndofs, new_dofs);
- count_dofs_per_component (mg_dof, ndofs, true, target_component);
- }
-
- for (unsigned int level=v.get_minlevel();
- level<=v.get_maxlevel();++level)
- {
- v[level].reinit(ndofs[level][selected_block]);
- }
-}
-
-
-template <int dim, typename number, int spacedim>
-void
-MGTools::reinit_vector_by_blocks (
- const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<BlockVector<number> > &v,
- const std::vector<bool> &sel,
- std::vector<std::vector<unsigned int> >& ndofs)
-{
- std::vector<bool> selected=sel;
- // Compute the number of blocks needed
- const unsigned int n_selected
- = std::accumulate(selected.begin(),
- selected.end(),
- 0U);
-
- if (ndofs.size() == 0)
- {
- std::vector<std::vector<unsigned int> >
- new_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(selected.size()));
- std::swap(ndofs, new_dofs);
- count_dofs_per_block (mg_dof, ndofs);
- }
-
- for (unsigned int level=v.get_minlevel();
- level<=v.get_maxlevel();++level)
- {
- v[level].reinit(n_selected, 0);
- unsigned int k=0;
- for (unsigned int i=0;i<selected.size() && (k<v[level].n_blocks());++i)
- {
- if (selected[i])
- {
- v[level].block(k++).reinit(ndofs[level][i]);
- }
- v[level].collect_sizes();
- }
- }
-}
-
-
-template <int dim, typename number, int spacedim>
-void
-MGTools::reinit_vector_by_blocks (
- const MGDoFHandler<dim,spacedim> &mg_dof,
- MGLevelObject<Vector<number> > &v,
- const unsigned int selected_block,
- std::vector<std::vector<unsigned int> >& ndofs)
-{
- const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
- Assert(selected_block < n_blocks, ExcIndexRange(selected_block, 0, n_blocks));
-
- std::vector<bool> selected(n_blocks, false);
- selected[selected_block] = true;
-
- if (ndofs.size() == 0)
- {
- std::vector<std::vector<unsigned int> >
- new_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(selected.size()));
- std::swap(ndofs, new_dofs);
- count_dofs_per_block (mg_dof, ndofs);
- }
-
- for (unsigned int level=v.get_minlevel();
- level<=v.get_maxlevel();++level)
- {
- v[level].reinit(ndofs[level][selected_block]);
- }
-}
mg_dof_handler.n_dofs(l)));
Assert (boundary_interface_dofs[l].size() == mg_dof_handler.n_dofs(l),
ExcDimensionMismatch (boundary_interface_dofs[l].size(),
- mg_dof_handler.n_dofs(l)));
+ mg_dof_handler.n_dofs(l)));
std::fill (interface_dofs[l].begin(),
interface_dofs[l].end(),
boundary_interface_dofs[l].end(),
false);
}
-
+
const FiniteElement<dim,spacedim> &fe = mg_dof_handler.get_fe();
-
+
const unsigned int dofs_per_cell = fe.dofs_per_cell;
const unsigned int dofs_per_face = fe.dofs_per_face;
std::vector<bool> cell_dofs(dofs_per_cell, false);
std::vector<bool> boundary_cell_dofs(dofs_per_cell, false);
-
+
typename MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
endc = mg_dof_handler.end();
for (; cell!=endc; ++cell)
{
bool has_coarser_neighbor = false;
-
+
std::fill (cell_dofs.begin(), cell_dofs.end(), false);
std::fill (boundary_cell_dofs.begin(), boundary_cell_dofs.end(), false);
-
+
for (unsigned int face_nr=0; face_nr<GeometryInfo<dim>::faces_per_cell; ++face_nr)
{
const typename DoFHandler<dim>::face_iterator face = cell->face(face_nr);
if (cell_dofs[fe.face_to_cell_index(j,face_nr)] == true)
boundary_cell_dofs[fe.face_to_cell_index(j,face_nr)] = true;
-
+
const unsigned int level = cell->level();
cell->get_mg_dof_indices (local_dof_indices);
std::vector<unsigned int>&,
const Table<2,DoFTools::Coupling>&, const Table<2,DoFTools::Coupling>&);
-template void MGTools::reinit_vector<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<double> >&);
-template void MGTools::reinit_vector<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<float> >&);
-
-template void MGTools::reinit_vector<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<double> >&);
-template void MGTools::reinit_vector<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<float> >&);
-
-template void MGTools::reinit_vector_by_components<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<double> >&,
- const std::vector<bool> &,
- const std::vector<unsigned int> &,
- std::vector<std::vector<unsigned int> >&);
-template void MGTools::reinit_vector_by_components<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<float> >&,
- const std::vector<bool> &,
- const std::vector<unsigned int> &,
- std::vector<std::vector<unsigned int> >&);
-
-template void MGTools::reinit_vector_by_components<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, MGLevelObject<Vector<double> >&,
- const std::vector<bool>&, const std::vector<unsigned int>&,
- std::vector<std::vector<unsigned int> >&);
-template void MGTools::reinit_vector_by_components<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, MGLevelObject<Vector<float> >&,
- const std::vector<bool>&, const std::vector<unsigned int>&,
- std::vector<std::vector<unsigned int> >&);
-
-template void MGTools::reinit_vector_by_blocks<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, MGLevelObject<BlockVector<double> >&,
- const std::vector<bool> &, std::vector<std::vector<unsigned int> >&);
-template void MGTools::reinit_vector_by_blocks<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, MGLevelObject<BlockVector<float> >&,
- const std::vector<bool> &, std::vector<std::vector<unsigned int> >&);
-
-template void MGTools::reinit_vector_by_blocks<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, MGLevelObject<Vector<double> >&,
- unsigned int, std::vector<std::vector<unsigned int> >&);
-template void MGTools::reinit_vector_by_blocks<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, MGLevelObject<Vector<float> >&,
- unsigned int, std::vector<std::vector<unsigned int> >&);
-
template void MGTools::count_dofs_per_component<deal_II_dimension> (
const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
bool, std::vector<unsigned int>);