void LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
void LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
// preconditioner. First, we need transfer between grid levels. The object
// we are using here generates sparse matrices for these transfers.
MGTransferPrebuilt<Vector<double>> mg_transfer;
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
// Then, we need an exact solver for the matrix on the coarsest level.
FullMatrix<double> coarse_matrix;
// Transfer operators between levels
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(velocity_dof_handler);
+ mg_transfer.build(velocity_dof_handler);
// Setup coarse grid solver
FullMatrix<double> coarse_matrix;
using Transfer = MGTransferPrebuilt<Vector<double>>;
Transfer mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
*/
template <int dim, class InVector, int spacedim>
void
- copy_to_mg(const DoFHandler<dim, spacedim> &mg_dof,
+ copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<VectorType> & dst,
const InVector & src) const;
*/
template <int dim, class OutVector, int spacedim>
void
- copy_from_mg(const DoFHandler<dim, spacedim> &mg_dof,
+ copy_from_mg(const DoFHandler<dim, spacedim> &dof_handler,
OutVector & dst,
const MGLevelObject<VectorType> &src) const;
*/
template <int dim, class OutVector, int spacedim>
void
- copy_from_mg_add(const DoFHandler<dim, spacedim> &mg_dof,
+ copy_from_mg_add(const DoFHandler<dim, spacedim> &dof_handler,
OutVector & dst,
const MGLevelObject<VectorType> &src) const;
*/
template <int dim, int spacedim>
void
- fill_and_communicate_copy_indices(const DoFHandler<dim, spacedim> &mg_dof);
+ fill_and_communicate_copy_indices(
+ const DoFHandler<dim, spacedim> &dof_handler);
/**
* Sizes of the multi-level vectors.
*/
template <int dim, typename Number2, int spacedim>
void
- copy_to_mg(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
const LinearAlgebra::distributed::Vector<Number2> &src) const;
template <int dim, typename Number2, int spacedim>
void
copy_from_mg(
- const DoFHandler<dim, spacedim> & mg_dof,
- LinearAlgebra::distributed::Vector<Number2> & dst,
+ const DoFHandler<dim, spacedim> & dof_handler,
+ LinearAlgebra::distributed::Vector<Number2> &dst,
const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const;
/**
template <int dim, typename Number2, int spacedim>
void
copy_from_mg_add(
- const DoFHandler<dim, spacedim> & mg_dof,
- LinearAlgebra::distributed::Vector<Number2> & dst,
+ const DoFHandler<dim, spacedim> & dof_handler,
+ LinearAlgebra::distributed::Vector<Number2> &dst,
const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const;
/**
*/
template <int dim, typename Number2, int spacedim>
void
- copy_to_mg(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
const LinearAlgebra::distributed::Vector<Number2> & src,
const bool solution_transfer) const;
*/
template <int dim, int spacedim>
void
- fill_and_communicate_copy_indices(const DoFHandler<dim, spacedim> &mg_dof);
+ fill_and_communicate_copy_indices(
+ const DoFHandler<dim, spacedim> &dof_handler);
/**
* Sizes of the multi-level vectors.
virtual ~MGTransferPrebuilt() override = default;
/**
- * Initialize the constraints to be used in build_matrices().
+ * Initialize the constraints to be used in build().
*/
void
initialize_constraints(const MGConstrainedDoFs &mg_constrained_dofs);
/**
- * Initialize the constraints to be used in build_matrices().
+ * Initialize the constraints to be used in build().
*
* @deprecated @p constraints is unused.
*/
void
clear();
+ /**
+ * Actually build the information required for the transfer operations. Needs
+ * to be called before prolongate() or restrict_and_add() can be used.
+ */
+ template <int dim, int spacedim>
+ void
+ build(const DoFHandler<dim, spacedim> &dof_handler);
+
/**
* Actually build the prolongation matrices for each level.
+ *
+ * @deprecated use build() instead.
*/
+ DEAL_II_DEPRECATED
template <int dim, int spacedim>
void
- build_matrices(const DoFHandler<dim, spacedim> &mg_dof);
+ build_matrices(const DoFHandler<dim, spacedim> &dof_handler);
/**
* Prolongate a vector from level <tt>to_level-1</tt> to level
DeclException0(ExcNoProlongation);
/**
- * You have to call build_matrices() before using this object.
+ * You have to call build() before using this object.
*/
DeclException0(ExcMatricesNotBuilt);
*/
template <int dim, typename number, int spacedim>
void
- reinit_vector(const dealii::DoFHandler<dim, spacedim> &mg_dof,
+ reinit_vector(const dealii::DoFHandler<dim, spacedim> &dof_handler,
const std::vector<unsigned int> &,
MGLevelObject<dealii::Vector<number>> &v)
{
for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
{
- unsigned int n = mg_dof.n_dofs(level);
+ unsigned int n = dof_handler.n_dofs(level);
v[level].reinit(n);
}
}
*/
template <int dim, typename number, int spacedim>
void
- reinit_vector(const dealii::DoFHandler<dim, spacedim> &mg_dof,
+ reinit_vector(const dealii::DoFHandler<dim, spacedim> &dof_handler,
std::vector<unsigned int> target_component,
MGLevelObject<BlockVector<number>> & v)
{
- const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
+ const unsigned int n_blocks = dof_handler.get_fe().n_blocks();
if (target_component.size() == 0)
{
target_component.resize(n_blocks);
const unsigned int n_target_blocks = max_block + 1;
std::vector<std::vector<types::global_dof_index>> ndofs(
- mg_dof.get_triangulation().n_levels(),
+ dof_handler.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(n_target_blocks));
- MGTools::count_dofs_per_block(mg_dof, ndofs, target_component);
+ MGTools::count_dofs_per_block(dof_handler, ndofs, target_component);
for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
{
*/
template <int dim, int spacedim>
void
- reinit_vector(const dealii::DoFHandler<dim, spacedim> &mg_dof,
+ reinit_vector(const dealii::DoFHandler<dim, spacedim> &dof_handler,
const std::vector<unsigned int> &,
MGLevelObject<TrilinosWrappers::MPI::Vector> &v)
{
const dealii::parallel::TriangulationBase<dim, spacedim> *tria =
(dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- &mg_dof.get_triangulation()));
+ &dof_handler.get_triangulation()));
AssertThrow(
tria != nullptr,
ExcMessage(
for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
{
- v[level].reinit(mg_dof.locally_owned_mg_dofs(level),
+ v[level].reinit(dof_handler.locally_owned_mg_dofs(level),
tria->get_communicator());
}
}
*/
template <int dim, int spacedim>
void
- reinit_vector(const dealii::DoFHandler<dim, spacedim> &mg_dof,
+ reinit_vector(const dealii::DoFHandler<dim, spacedim> &dof_handler,
const std::vector<unsigned int> &,
MGLevelObject<PETScWrappers::MPI::Vector> &v)
{
const dealii::parallel::TriangulationBase<dim, spacedim> *tria =
(dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- &mg_dof.get_triangulation()));
+ &dof_handler.get_triangulation()));
AssertThrow(
tria != nullptr,
ExcMessage(
for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
{
- v[level].reinit(mg_dof.locally_owned_mg_dofs(level),
+ v[level].reinit(dof_handler.locally_owned_mg_dofs(level),
tria->get_communicator());
}
}
template <int dim, class InVector, int spacedim>
void
MGLevelGlobalTransfer<VectorType>::copy_to_mg(
- const DoFHandler<dim, spacedim> &mg_dof_handler,
+ const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<VectorType> & dst,
const InVector & src) const
{
AssertIndexRange(dst.max_level(),
- mg_dof_handler.get_triangulation().n_global_levels());
+ dof_handler.get_triangulation().n_global_levels());
AssertIndexRange(dst.min_level(), dst.max_level() + 1);
- internal::MGTransfer::reinit_vector(mg_dof_handler,
- component_to_block_map,
- dst);
+ internal::MGTransfer::reinit_vector(dof_handler, component_to_block_map, dst);
#ifdef DEBUG_OUTPUT
std::cout << "copy_to_mg src " << src.l2_norm() << std::endl;
int ierr = MPI_Barrier(MPI_COMM_WORLD);
template <int dim, class OutVector, int spacedim>
void
MGLevelGlobalTransfer<VectorType>::copy_from_mg(
- const DoFHandler<dim, spacedim> &mg_dof_handler,
+ const DoFHandler<dim, spacedim> &dof_handler,
OutVector & dst,
const MGLevelObject<VectorType> &src) const
{
- (void)mg_dof_handler;
+ (void)dof_handler;
AssertIndexRange(src.max_level(),
- mg_dof_handler.get_triangulation().n_global_levels());
+ dof_handler.get_triangulation().n_global_levels());
AssertIndexRange(src.min_level(), src.max_level() + 1);
if (perform_plain_copy)
{
template <int dim, class OutVector, int spacedim>
void
MGLevelGlobalTransfer<VectorType>::copy_from_mg_add(
- const DoFHandler<dim, spacedim> & /*mg_dof_handler*/,
+ const DoFHandler<dim, spacedim> & /*dof_handler*/,
OutVector & dst,
const MGLevelObject<VectorType> &src) const
{
template <int dim, typename Number2, int spacedim>
void
MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::copy_to_mg(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
const LinearAlgebra::distributed::Vector<Number2> & src) const
{
- copy_to_mg(mg_dof_handler, dst, src, false);
+ copy_to_mg(dof_handler, dst, src, false);
}
template <int dim, typename Number2, int spacedim>
void
MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::copy_to_mg(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
const LinearAlgebra::distributed::Vector<Number2> & src,
const bool solution_transfer) const
solution_transfer ? solution_copy_indices_level_mine :
copy_indices_level_mine;
- (void)mg_dof_handler;
+ (void)dof_handler;
AssertIndexRange(dst.max_level(),
- mg_dof_handler.get_triangulation().n_global_levels());
+ dof_handler.get_triangulation().n_global_levels());
AssertIndexRange(dst.min_level(), dst.max_level() + 1);
for (unsigned int level = dst.min_level(); level <= dst.max_level(); ++level)
- if (dst[level].size() != mg_dof_handler.n_dofs(level) ||
+ if (dst[level].size() != dof_handler.n_dofs(level) ||
dst[level].local_size() !=
- mg_dof_handler.locally_owned_mg_dofs(level).n_elements())
+ dof_handler.locally_owned_mg_dofs(level).n_elements())
{
// In case a ghosted level vector has been initialized, we can simply
// use that as a template for the vector partitioning. If not, we
// resort to the locally owned range of the dof handler.
if (level <= ghosted_level_vector.max_level() &&
- ghosted_level_vector[level].size() == mg_dof_handler.n_dofs(level))
+ ghosted_level_vector[level].size() == dof_handler.n_dofs(level))
dst[level].reinit(ghosted_level_vector[level], false);
else
{
const parallel::TriangulationBase<dim, spacedim> *tria =
(dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- &mg_dof_handler.get_triangulation()));
- dst[level].reinit(mg_dof_handler.locally_owned_mg_dofs(level),
+ &dof_handler.get_triangulation()));
+ dst[level].reinit(dof_handler.locally_owned_mg_dofs(level),
tria != nullptr ? tria->get_communicator() :
MPI_COMM_SELF);
}
template <int dim, typename Number2, int spacedim>
void
MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::copy_from_mg(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
- LinearAlgebra::distributed::Vector<Number2> &dst,
+ const DoFHandler<dim, spacedim> & dof_handler,
+ LinearAlgebra::distributed::Vector<Number2> & dst,
const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const
{
- (void)mg_dof_handler;
+ (void)dof_handler;
AssertIndexRange(src.max_level(),
- mg_dof_handler.get_triangulation().n_global_levels());
+ dof_handler.get_triangulation().n_global_levels());
AssertIndexRange(src.min_level(), src.max_level() + 1);
if (perform_plain_copy)
{
void
MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::
copy_from_mg_add(
- const DoFHandler<dim, spacedim> & /*mg_dof_handler*/,
+ const DoFHandler<dim, spacedim> & /*dof_handler*/,
LinearAlgebra::distributed::Vector<Number2> & dst,
const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const
{
*/
template <int dim, int spacedim>
void
+ build(const DoFHandler<dim, spacedim> &dof_handler);
+
+ /**
+ * Actually build the prolongation matrices for each level.
+ *
+ * This function is only called by derived classes. These can also set the
+ * member variables #selected and others to restrict the transfer matrices
+ * to certain blocks.
+ *
+ * @deprecated Use build() instead.
+ */
+ DEAL_II_DEPRECATED
+ template <int dim, int spacedim>
+ void
build_matrices(const DoFHandler<dim, spacedim> &dof,
const DoFHandler<dim, spacedim> &mg_dof);
std::vector<std::vector<types::global_dof_index>> mg_block_start;
/**
- * Call build_matrices() function first.
+ * Call build() function first.
*/
DeclException0(ExcMatricesNotBuilt);
*/
template <int dim, int spacedim>
void
+ build(const DoFHandler<dim, spacedim> &dof_handler,
+ const std::vector<bool> & selected);
+
+ /**
+ * Build the prolongation matrices for each level.
+ *
+ * This function is a front-end for the same function in
+ * MGTransferBlockBase.
+ *
+ * @deprecated Use the build() function instead.
+ */
+ DEAL_II_DEPRECATED
+ template <int dim, int spacedim>
+ void
build_matrices(const DoFHandler<dim, spacedim> &dof,
const DoFHandler<dim, spacedim> &mg_dof,
const std::vector<bool> & selected);
*/
template <int dim, typename number2, int spacedim>
void
- copy_to_mg(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_to_mg(const DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<BlockVector<number>> &dst,
const BlockVector<number2> & src) const;
*/
template <int dim, typename number2, int spacedim>
void
- copy_from_mg(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_from_mg(const DoFHandler<dim, spacedim> & dof_handler,
BlockVector<number2> & dst,
const MGLevelObject<BlockVector<number>> &src) const;
*/
template <int dim, typename number2, int spacedim>
void
- copy_from_mg_add(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_from_mg_add(const DoFHandler<dim, spacedim> & dof_handler,
BlockVector<number2> & dst,
const MGLevelObject<BlockVector<number>> &src) const;
* This function is a front-end for the same function in
* MGTransferBlockBase.
*
- * @arg selected: Number of the block of the global vector to be copied from
+ * @param dof_handler The DoFHandler to use.
+ * @param selected Number of the block for which the transfer matrices
+ * should be built.
+ */
+ template <int dim, int spacedim>
+ void
+ build(const DoFHandler<dim, spacedim> &dof_handler, unsigned int selected);
+
+ /**
+ * Actually build the prolongation matrices for grouped blocks.
+ *
+ * This function is a front-end for the same function in
+ * MGTransferBlockBase.
+ *
+ * @param selected Number of the block of the global vector to be copied from
* and to the multilevel vector.
*
- * @arg mg_selected: Number of the component for which the transfer matrices
- * should be built.
+ * @deprecated Use build() instead.
*/
+ DEAL_II_DEPRECATED
template <int dim, int spacedim>
void
build_matrices(const DoFHandler<dim, spacedim> &dof,
*/
template <int dim, typename number2, int spacedim>
void
- copy_to_mg(const DoFHandler<dim, spacedim> &mg_dof,
+ copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<Vector<number>> & dst,
const Vector<number2> & src) const;
*/
template <int dim, typename number2, int spacedim>
void
- copy_from_mg(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_from_mg(const DoFHandler<dim, spacedim> & dof_handler,
Vector<number2> & dst,
const MGLevelObject<Vector<number>> &src) const;
*/
template <int dim, typename number2, int spacedim>
void
- copy_from_mg_add(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_from_mg_add(const DoFHandler<dim, spacedim> & dof_handler,
Vector<number2> & dst,
const MGLevelObject<Vector<number>> &src) const;
*/
template <int dim, typename number2, int spacedim>
void
- copy_to_mg(const DoFHandler<dim, spacedim> &mg_dof,
+ copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<Vector<number>> & dst,
const BlockVector<number2> & src) const;
*/
template <int dim, typename number2, int spacedim>
void
- copy_from_mg(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_from_mg(const DoFHandler<dim, spacedim> & dof_handler,
BlockVector<number2> & dst,
const MGLevelObject<Vector<number>> &src) const;
*/
template <int dim, typename number2, int spacedim>
void
- copy_from_mg_add(const DoFHandler<dim, spacedim> & mg_dof,
+ copy_from_mg_add(const DoFHandler<dim, spacedim> & dof_handler,
BlockVector<number2> & dst,
const MGLevelObject<Vector<number>> &src) const;
*/
template <int dim, class OutVector, int spacedim>
void
- do_copy_from_mg(const DoFHandler<dim, spacedim> & mg_dof,
+ do_copy_from_mg(const DoFHandler<dim, spacedim> & dof_handler,
OutVector & dst,
const MGLevelObject<Vector<number>> &src,
const unsigned int offset) const;
*/
template <int dim, class OutVector, int spacedim>
void
- do_copy_from_mg_add(const DoFHandler<dim, spacedim> & mg_dof,
+ do_copy_from_mg_add(const DoFHandler<dim, spacedim> & dof_handler,
OutVector & dst,
const MGLevelObject<Vector<number>> &src,
const unsigned int offset) const;
*/
template <int dim, class InVector, int spacedim>
void
- do_copy_to_mg(const DoFHandler<dim, spacedim> &mg_dof,
+ do_copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<Vector<number>> & dst,
const InVector & src,
const unsigned int offset) const;
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_from_mg(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
BlockVector<number2> & dst,
const MGLevelObject<Vector<number>> &src) const
{
for (unsigned int level = 0;
- level < mg_dof_handler.get_triangulation().n_levels();
+ level < dof_handler.get_triangulation().n_levels();
++level)
for (IT i = copy_indices[selected_block][level].begin();
i != copy_indices[selected_block][level].end();
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_from_mg(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
Vector<number2> & dst,
const MGLevelObject<Vector<number>> &src) const
{
for (unsigned int level = 0;
- level < mg_dof_handler.get_triangulation().n_levels();
+ level < dof_handler.get_triangulation().n_levels();
++level)
for (IT i = copy_indices[selected_block][level].begin();
i != copy_indices[selected_block][level].end();
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_from_mg_add(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
BlockVector<number2> & dst,
const MGLevelObject<Vector<number>> &src) const
{
for (unsigned int level = 0;
- level < mg_dof_handler.get_triangulation().n_levels();
+ level < dof_handler.get_triangulation().n_levels();
++level)
for (IT i = copy_indices[selected_block][level].begin();
i != copy_indices[selected_block][level].end();
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_from_mg_add(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
Vector<number2> & dst,
const MGLevelObject<Vector<number>> &src) const
{
for (unsigned int level = 0;
- level < mg_dof_handler.get_triangulation().n_levels();
+ level < dof_handler.get_triangulation().n_levels();
++level)
for (IT i = copy_indices[selected_block][level].begin();
i != copy_indices[selected_block][level].end();
template <int dim, typename number2, int spacedim>
void
MGTransferBlock<number>::copy_from_mg(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
BlockVector<number2> & dst,
const MGLevelObject<BlockVector<number>> &src) const
{
for (unsigned int block = 0; block < selected.size(); ++block)
if (selected[block])
for (unsigned int level = 0;
- level < mg_dof_handler.get_triangulation().n_levels();
+ level < dof_handler.get_triangulation().n_levels();
++level)
for (IT i = copy_indices[block][level].begin();
i != copy_indices[block][level].end();
template <int dim, typename number2, int spacedim>
void
MGTransferBlock<number>::copy_from_mg_add(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
BlockVector<number2> & dst,
const MGLevelObject<BlockVector<number>> &src) const
{
for (unsigned int block = 0; block < selected.size(); ++block)
if (selected[block])
for (unsigned int level = 0;
- level < mg_dof_handler.get_triangulation().n_levels();
+ level < dof_handler.get_triangulation().n_levels();
++level)
for (IT i = copy_indices[block][level].begin();
i != copy_indices[block][level].end();
*/
template <int dim, int spacedim>
void
+ build(const DoFHandler<dim, spacedim> &dof_handler);
+
+ /**
+ * Actually build the prolongation matrices for each level.
+ *
+ * This function is only called by derived classes. These can also set the
+ * member variables <code>selected_component</code> and
+ * <code>mg_selected_component</code> member variables to restrict the
+ * transfer matrices to certain components. Furthermore, they use
+ * <code>target_component</code> and <code>mg_target_component</code> for
+ * re-ordering and grouping of components.
+ *
+ * @deprecated Use build() instead.
+ */
+ DEAL_II_DEPRECATED
+ template <int dim, int spacedim>
+ void
build_matrices(const DoFHandler<dim, spacedim> &dof,
const DoFHandler<dim, spacedim> &mg_dof);
std::vector<std::vector<types::global_dof_index>> mg_component_start;
/**
- * Call build_matrices() function first.
+ * Call build() function first.
*/
DeclException0(ExcMatricesNotBuilt);
* It also affects the behavior of the <tt>selected</tt> argument
*
* @arg boundary_indices: holds the boundary indices on each level.
+ *
+ * @deprecated Use build() instead.
*/
+ DEAL_II_DEPRECATED
template <int dim, int spacedim>
void
build_matrices(
const std::vector<std::set<types::global_dof_index>> &boundary_indices =
std::vector<std::set<types::global_dof_index>>());
+ /**
+ * Actually build the prolongation matrices for grouped components.
+ *
+ * This function is a front-end for the same function in
+ * MGTransferComponentBase.
+ *
+ * @arg selected Number of the block of the global vector to be copied from
+ * and to the multilevel vector. This number refers to the renumbering by
+ * <tt>target_component</tt>.
+ *
+ * @arg mg_selected Number of the block for which the transfer matrices
+ * should be built.
+ *
+ * If <tt>mg_target_component</tt> is present, this refers to the renumbered
+ * components.
+ *
+ * @arg target_component this argument allows grouping and renumbering of
+ * components in the fine-level vector (see DoFRenumbering::component_wise).
+ *
+ * @arg mg_target_component this argument allows grouping and renumbering
+ * of components in the level vectors (see DoFRenumbering::component_wise).
+ * It also affects the behavior of the <tt>selected</tt> argument
+ *
+ * @arg boundary_indices holds the boundary indices on each level.
+ */
+ template <int dim, int spacedim>
+ void
+ build(const DoFHandler<dim, spacedim> &dof,
+ unsigned int selected,
+ unsigned int mg_selected,
+ const std::vector<unsigned int> &target_component =
+ std::vector<unsigned int>(),
+ const std::vector<unsigned int> &mg_target_component =
+ std::vector<unsigned int>(),
+ const std::vector<std::set<types::global_dof_index>> &boundary_indices =
+ std::vector<std::set<types::global_dof_index>>());
+
/**
* Change selected component. Handle with care!
*/
template <int dim, int spacedim>
void
fill_copy_indices(
- const DoFHandler<dim, spacedim> &mg_dof,
+ const DoFHandler<dim, spacedim> &dof_handler,
const MGConstrainedDoFs * mg_constrained_dofs,
std::vector<std::vector<
std::pair<types::global_dof_index, types::global_dof_index>>>
template <int dim, typename Number>
void
setup_transfer(
- const DoFHandler<dim> & mg_dof,
+ const DoFHandler<dim> & dof_handler,
const MGConstrainedDoFs *mg_constrained_dofs,
const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
& external_partitioners,
* ignored and internal variants are used instead.
*/
void
- build(const DoFHandler<dim, dim> &mg_dof,
+ build(const DoFHandler<dim, dim> &dof_handler,
const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
&external_partitioners =
std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>());
const LinearAlgebra::distributed::Vector<Number> &src) const override;
/**
- * Restrict fine-mesh field @p src to each multigrid level in @p mg_dof and
+ * Restrict fine-mesh field @p src to each multigrid level in @p dof_handler and
* store the result in @p dst.
*
* If @p dst is empty or has incorrect locally owned size, it will be
template <typename Number2, int spacedim>
void
interpolate_to_mg(
- const DoFHandler<dim, spacedim> & mg_dof,
+ const DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
const LinearAlgebra::distributed::Vector<Number2> & src) const;
* Actually build the information for the prolongation for each level.
*/
void
- build(const DoFHandler<dim, dim> &mg_dof);
+ build(const DoFHandler<dim, dim> &dof_handler);
/**
* Same as above for the case that each block has its own DoFHandler.
*/
void
- build(const std::vector<const DoFHandler<dim, dim> *> &mg_dof);
+ build(const std::vector<const DoFHandler<dim, dim> *> &dof_handler);
/**
* Prolongate a vector from level <tt>to_level-1</tt> to level
template <typename Number2, int spacedim>
void
copy_to_mg(
- const DoFHandler<dim, spacedim> & mg_dof,
+ const DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &dst,
const LinearAlgebra::distributed::BlockVector<Number2> & src) const;
template <typename Number2, int spacedim>
void
copy_to_mg(
- const std::vector<const DoFHandler<dim, spacedim> *> & mg_dof,
+ const std::vector<const DoFHandler<dim, spacedim> *> & dof_handler,
MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &dst,
const LinearAlgebra::distributed::BlockVector<Number2> & src) const;
template <typename Number2, int spacedim>
void
copy_from_mg(
- const DoFHandler<dim, spacedim> & mg_dof,
+ const DoFHandler<dim, spacedim> & dof_handler,
LinearAlgebra::distributed::BlockVector<Number2> &dst,
const MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &src)
const;
template <typename Number2, int spacedim>
void
copy_from_mg(
- const std::vector<const DoFHandler<dim, spacedim> *> &mg_dof,
+ const std::vector<const DoFHandler<dim, spacedim> *> &dof_handler,
LinearAlgebra::distributed::BlockVector<Number2> & dst,
const MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &src)
const;
template <typename Number2, int spacedim>
void
MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
- const DoFHandler<dim, spacedim> & mg_dof,
+ const DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &dst,
const LinearAlgebra::distributed::BlockVector<Number2> & src) const
{
"DoFHandler for each block, but this method assumes that "
"the same DoFHandler is used for all the blocks!"));
const std::vector<const DoFHandler<dim, spacedim> *> mg_dofs(src.n_blocks(),
- &mg_dof);
+ &dof_handler);
copy_to_mg(mg_dofs, dst, src);
}
template <typename Number2, int spacedim>
void
MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
- const std::vector<const DoFHandler<dim, spacedim> *> & mg_dof,
+ const std::vector<const DoFHandler<dim, spacedim> *> & dof_handler,
MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &dst,
const LinearAlgebra::distributed::BlockVector<Number2> & src) const
{
const unsigned int n_blocks = src.n_blocks();
- AssertDimension(mg_dof.size(), n_blocks);
+ AssertDimension(dof_handler.size(), n_blocks);
if (n_blocks == 0)
return;
{
const parallel::TriangulationBase<dim, spacedim> *tria =
(dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- &(mg_dof[0]->get_triangulation())));
+ &(dof_handler[0]->get_triangulation())));
for (unsigned int i = 1; i < n_blocks; ++i)
AssertThrow(
(dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- &(mg_dof[0]->get_triangulation())) == tria),
+ &(dof_handler[0]->get_triangulation())) == tria),
ExcMessage("The DoFHandler use different Triangulations!"));
MGLevelObject<bool> do_reinit;
for (unsigned int b = 0; b < n_blocks; ++b)
{
LinearAlgebra::distributed::Vector<Number> &v = dst[level].block(b);
- if (v.size() != mg_dof[b]->locally_owned_mg_dofs(level).size() ||
+ if (v.size() !=
+ dof_handler[b]->locally_owned_mg_dofs(level).size() ||
v.local_size() !=
- mg_dof[b]->locally_owned_mg_dofs(level).n_elements())
+ dof_handler[b]->locally_owned_mg_dofs(level).n_elements())
{
do_reinit[level] = true;
break; // b
{
LinearAlgebra::distributed::Vector<Number> &v =
dst[level].block(b);
- v.reinit(mg_dof[b]->locally_owned_mg_dofs(level),
+ v.reinit(dof_handler[b]->locally_owned_mg_dofs(level),
tria != nullptr ? tria->get_communicator() :
MPI_COMM_SELF);
}
for (unsigned int l = min_level; l <= max_level; ++l)
dst_non_block[l].reinit(dst[l].block(b));
const unsigned int data_block = same_for_all ? 0 : b;
- matrix_free_transfer_vector[data_block].copy_to_mg(*mg_dof[b],
+ matrix_free_transfer_vector[data_block].copy_to_mg(*dof_handler[b],
dst_non_block,
src.block(b));
template <typename Number2, int spacedim>
void
MGTransferBlockMatrixFree<dim, Number>::copy_from_mg(
- const DoFHandler<dim, spacedim> & mg_dof,
- LinearAlgebra::distributed::BlockVector<Number2> & dst,
+ const DoFHandler<dim, spacedim> & dof_handler,
+ LinearAlgebra::distributed::BlockVector<Number2> &dst,
const MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &src)
const
{
AssertDimension(matrix_free_transfer_vector.size(), 1);
const std::vector<const DoFHandler<dim, spacedim> *> mg_dofs(dst.n_blocks(),
- &mg_dof);
+ &dof_handler);
copy_from_mg(mg_dofs, dst, src);
}
template <typename Number2, int spacedim>
void
MGTransferBlockMatrixFree<dim, Number>::copy_from_mg(
- const std::vector<const DoFHandler<dim, spacedim> *> & mg_dof,
- LinearAlgebra::distributed::BlockVector<Number2> & dst,
+ const std::vector<const DoFHandler<dim, spacedim> *> &dof_handler,
+ LinearAlgebra::distributed::BlockVector<Number2> & dst,
const MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &src)
const
{
const unsigned int n_blocks = dst.n_blocks();
- AssertDimension(mg_dof.size(), n_blocks);
+ AssertDimension(dof_handler.size(), n_blocks);
if (n_blocks == 0)
return;
src_non_block[l] = src[l].block(b);
}
const unsigned int data_block = same_for_all ? 0 : b;
- matrix_free_transfer_vector[data_block].copy_from_mg(*mg_dof[b],
+ matrix_free_transfer_vector[data_block].copy_from_mg(*dof_handler[b],
dst.block(b),
src_non_block);
}
#ifndef _MSC_VER
DEAL_II_DEPRECATED
#endif
- Multigrid(const DoFHandler<dim> & mg_dof_handler,
+ Multigrid(const DoFHandler<dim> & dof_handler,
const MGMatrixBase<VectorType> & matrix,
const MGCoarseGridBase<VectorType> &coarse,
const MGTransferBase<VectorType> & transfer,
template <typename VectorType>
template <int dim>
-Multigrid<VectorType>::Multigrid(const DoFHandler<dim> & mg_dof_handler,
+Multigrid<VectorType>::Multigrid(const DoFHandler<dim> & dof_handler,
const MGMatrixBase<VectorType> &matrix,
const MGCoarseGridBase<VectorType> &coarse,
const MGTransferBase<VectorType> & transfer,
, debug(0)
{
const unsigned int dof_handler_max_level =
- mg_dof_handler.get_triangulation().n_global_levels() - 1;
+ dof_handler.get_triangulation().n_global_levels() - 1;
if (max_level == numbers::invalid_unsigned_int)
maxlevel = dof_handler_max_level;
else
template <int dim, typename number, int spacedim>
void
reinit_vector_by_blocks(
- const dealii::DoFHandler<dim, spacedim> & mg_dof,
+ const dealii::DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<BlockVector<number>> & v,
const std::vector<bool> & sel,
std::vector<std::vector<types::global_dof_index>> &ndofs)
if (ndofs.size() == 0)
{
std::vector<std::vector<types::global_dof_index>> new_dofs(
- mg_dof.get_triangulation().n_levels(),
+ dof_handler.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(selected.size()));
std::swap(ndofs, new_dofs);
- MGTools::count_dofs_per_block(mg_dof, ndofs);
+ MGTools::count_dofs_per_block(dof_handler, ndofs);
}
for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
template <int dim, typename number, int spacedim>
void
reinit_vector_by_blocks(
- const dealii::DoFHandler<dim, spacedim> & mg_dof,
+ const dealii::DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<dealii::Vector<number>> & v,
const unsigned int selected_block,
std::vector<std::vector<types::global_dof_index>> &ndofs)
{
- const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
+ const unsigned int n_blocks = dof_handler.get_fe().n_blocks();
AssertIndexRange(selected_block, n_blocks);
std::vector<bool> selected(n_blocks, false);
if (ndofs.size() == 0)
{
std::vector<std::vector<types::global_dof_index>> new_dofs(
- mg_dof.get_triangulation().n_levels(),
+ dof_handler.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(selected.size()));
std::swap(ndofs, new_dofs);
- MGTools::count_dofs_per_block(mg_dof, ndofs);
+ MGTools::count_dofs_per_block(dof_handler, ndofs);
}
for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_to_mg(
- const DoFHandler<dim, spacedim> &mg_dof_handler,
+ const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<Vector<number>> & dst,
const BlockVector<number2> & src) const
{
- reinit_vector_by_blocks(mg_dof_handler, dst, selected_block, sizes);
+ reinit_vector_by_blocks(dof_handler, dst, selected_block, sizes);
// For MGTransferBlockSelect, the
// multilevel block is always the
// first, since only one block is
// selected.
- for (unsigned int level = mg_dof_handler.get_triangulation().n_levels();
+ for (unsigned int level = dof_handler.get_triangulation().n_levels();
level != 0;)
{
--level;
template <int dim, typename number2, int spacedim>
void
MGTransferBlockSelect<number>::copy_to_mg(
- const DoFHandler<dim, spacedim> &mg_dof_handler,
+ const DoFHandler<dim, spacedim> &dof_handler,
MGLevelObject<Vector<number>> & dst,
const Vector<number2> & src) const
{
- reinit_vector_by_blocks(mg_dof_handler, dst, selected_block, sizes);
+ reinit_vector_by_blocks(dof_handler, dst, selected_block, sizes);
// For MGTransferBlockSelect, the
// multilevel block is always the
// first, since only one block is selected.
- for (unsigned int level = mg_dof_handler.get_triangulation().n_levels();
+ for (unsigned int level = dof_handler.get_triangulation().n_levels();
level != 0;)
{
--level;
template <int dim, typename number2, int spacedim>
void
MGTransferBlock<number>::copy_to_mg(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
MGLevelObject<BlockVector<number>> &dst,
const BlockVector<number2> & src) const
{
- reinit_vector_by_blocks(mg_dof_handler, dst, selected, sizes);
- for (unsigned int level = mg_dof_handler.get_triangulation().n_levels();
+ reinit_vector_by_blocks(dof_handler, dst, selected, sizes);
+ for (unsigned int level = dof_handler.get_triangulation().n_levels();
level != 0;)
{
--level;
template <int dim, int spacedim>
void
-MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
- const DoFHandler<dim, spacedim> &mg_dof)
+MGTransferBlockBase::build_matrices(
+ const DoFHandler<dim, spacedim> &dof,
+ const DoFHandler<dim, spacedim> &mg_dof_handler)
+{
+ build(mg_dof_handler);
+}
+
+
+
+template <int dim, int spacedim>
+void
+MGTransferBlockBase::build(const DoFHandler<dim, spacedim> &dof_handler)
{
- const FiniteElement<dim> &fe = mg_dof.get_fe();
+ const FiniteElement<dim> &fe = dof_handler.get_fe();
const unsigned int n_blocks = fe.n_blocks();
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_levels = mg_dof.get_triangulation().n_levels();
+ const unsigned int n_levels = dof_handler.get_triangulation().n_levels();
Assert(selected.size() == n_blocks,
ExcDimensionMismatch(selected.size(), n_blocks));
// Compute the lengths of all blocks
sizes.clear();
sizes.resize(n_levels, std::vector<types::global_dof_index>(fe.n_blocks()));
- MGTools::count_dofs_per_block(mg_dof, sizes);
+ MGTools::count_dofs_per_block(dof_handler, sizes);
// Fill some index vectors
// for later use.
block_start.resize(n_blocks);
DoFTools::count_dofs_per_block(
- static_cast<const DoFHandler<dim, spacedim> &>(mg_dof), block_start);
+ static_cast<const DoFHandler<dim, spacedim> &>(dof_handler), block_start);
types::global_dof_index k = 0;
for (types::global_dof_index &first_index : block_start)
prolongation_sparsities[level]->collect_sizes();
for (typename DoFHandler<dim, spacedim>::cell_iterator cell =
- mg_dof.begin(level);
- cell != mg_dof.end(level);
+ dof_handler.begin(level);
+ cell != dof_handler.end(level);
++cell)
if (cell->has_children())
{
// prolongation matrix for
// this child
const FullMatrix<double> &prolongation =
- mg_dof.get_fe().get_prolongation_matrix(
+ dof_handler.get_fe().get_prolongation_matrix(
child, cell->refinement_case());
cell->child(child)->get_mg_dof_indices(dof_indices_child);
prolongation_matrices[level]->reinit(*prolongation_sparsities[level]);
// now actually build the matrices
for (typename DoFHandler<dim, spacedim>::cell_iterator cell =
- mg_dof.begin(level);
- cell != mg_dof.end(level);
+ dof_handler.begin(level);
+ cell != dof_handler.end(level);
++cell)
if (cell->has_children())
{
// prolongation matrix for
// this child
const FullMatrix<double> &prolongation =
- mg_dof.get_fe().get_prolongation_matrix(
+ dof_handler.get_fe().get_prolongation_matrix(
child, cell->refinement_case());
cell->child(child)->get_mg_dof_indices(dof_indices_child);
}
}
-
-
template <typename number>
template <int dim, int spacedim>
void
MGTransferBlockSelect<number>::build_matrices(
- const DoFHandler<dim, spacedim> &dof,
+ const DoFHandler<dim, spacedim> & /*dof*/,
const DoFHandler<dim, spacedim> &mg_dof,
unsigned int select)
{
- const FiniteElement<dim> &fe = mg_dof.get_fe();
- unsigned int n_blocks = mg_dof.get_fe().n_blocks();
+ build(mg_dof, select);
+}
+
+template <typename number>
+template <int dim, int spacedim>
+void
+MGTransferBlockSelect<number>::build(
+ const DoFHandler<dim, spacedim> &dof_handler,
+ unsigned int select)
+{
+ const FiniteElement<dim> &fe = dof_handler.get_fe();
+ unsigned int n_blocks = dof_handler.get_fe().n_blocks();
selected_block = select;
selected.resize(n_blocks, false);
selected[select] = true;
- MGTransferBlockBase::build_matrices(dof, mg_dof);
+ MGTransferBlockBase::build(dof_handler);
std::vector<types::global_dof_index> temp_copy_indices;
std::vector<types::global_dof_index> global_dof_indices(fe.dofs_per_cell);
std::vector<types::global_dof_index> level_dof_indices(fe.dofs_per_cell);
- for (int level = dof.get_triangulation().n_levels() - 1; level >= 0; --level)
+ for (int level = dof_handler.get_triangulation().n_levels() - 1; level >= 0;
+ --level)
{
typename DoFHandler<dim, spacedim>::active_cell_iterator level_cell =
- mg_dof.begin_active(level);
+ dof_handler.begin_active(level);
const typename DoFHandler<dim, spacedim>::active_cell_iterator level_end =
- mg_dof.end_active(level);
+ dof_handler.end_active(level);
temp_copy_indices.resize(0);
temp_copy_indices.resize(sizes[level][selected_block],
}
+template <typename number>
+template <int dim, int spacedim>
+void
+MGTransferBlock<number>::build_matrices(
+ const DoFHandler<dim, spacedim> & /*dof*/,
+ const DoFHandler<dim, spacedim> &mg_dof,
+ const std::vector<bool> & sel)
+{
+ build(mg_dof, sel);
+}
template <typename number>
template <int dim, int spacedim>
void
-MGTransferBlock<number>::build_matrices(const DoFHandler<dim, spacedim> &dof,
- const DoFHandler<dim, spacedim> &mg_dof,
- const std::vector<bool> & sel)
+MGTransferBlock<number>::build(const DoFHandler<dim, spacedim> &dof_handler,
+ const std::vector<bool> & sel)
{
- const FiniteElement<dim> &fe = mg_dof.get_fe();
- unsigned int n_blocks = mg_dof.get_fe().n_blocks();
+ const FiniteElement<dim> &fe = dof_handler.get_fe();
+ unsigned int n_blocks = dof_handler.get_fe().n_blocks();
if (sel.size() != 0)
{
if (selected.size() == 0)
selected = std::vector<bool>(n_blocks, true);
- MGTransferBlockBase::build_matrices(dof, mg_dof);
+ MGTransferBlockBase::build(dof_handler);
std::vector<std::vector<types::global_dof_index>> temp_copy_indices(n_blocks);
std::vector<types::global_dof_index> global_dof_indices(fe.dofs_per_cell);
std::vector<types::global_dof_index> level_dof_indices(fe.dofs_per_cell);
- for (int level = dof.get_triangulation().n_levels() - 1; level >= 0; --level)
+ for (int level = dof_handler.get_triangulation().n_levels() - 1; level >= 0;
+ --level)
{
typename DoFHandler<dim, spacedim>::active_cell_iterator level_cell =
- mg_dof.begin_active(level);
+ dof_handler.begin_active(level);
const typename DoFHandler<dim, spacedim>::active_cell_iterator level_end =
- mg_dof.end_active(level);
+ dof_handler.end_active(level);
for (unsigned int block = 0; block < n_blocks; ++block)
if (selected[block])
for (deal_II_dimension : DIMENSIONS)
{
+ template void MGTransferBlock<float>::build<deal_II_dimension>(
+ const DoFHandler<deal_II_dimension> &, const std::vector<bool> &);
+
+ template void MGTransferBlock<double>::build<deal_II_dimension>(
+ const DoFHandler<deal_II_dimension> &, const std::vector<bool> &);
+
+ template void MGTransferBlockSelect<float>::build<deal_II_dimension>(
+ const DoFHandler<deal_II_dimension> &, const unsigned int);
+
+ template void MGTransferBlockSelect<double>::build<deal_II_dimension>(
+ const DoFHandler<deal_II_dimension> &, const unsigned int);
+
+ // deprecated:
template void MGTransferBlock<float>::build_matrices<deal_II_dimension>(
const DoFHandler<deal_II_dimension> &,
const DoFHandler<deal_II_dimension> &,
const std::vector<bool> &);
+ // deprecated:
template void MGTransferBlock<double>::build_matrices<deal_II_dimension>(
const DoFHandler<deal_II_dimension> &,
const DoFHandler<deal_II_dimension> &,
const std::vector<bool> &);
+ // deprecated:
template void MGTransferBlockSelect<float>::build_matrices<
deal_II_dimension>(const DoFHandler<deal_II_dimension> &,
const DoFHandler<deal_II_dimension> &,
const unsigned int);
+ // deprecated:
template void MGTransferBlockSelect<double>::build_matrices<
deal_II_dimension>(const DoFHandler<deal_II_dimension> &,
const DoFHandler<deal_II_dimension> &,
}
+
template <int dim, int spacedim>
void
MGTransferComponentBase::build_matrices(const DoFHandler<dim, spacedim> &,
const DoFHandler<dim, spacedim> &mg_dof)
+{
+ build(mg_dof);
+}
+
+
+
+template <int dim, int spacedim>
+void
+MGTransferComponentBase::build(const DoFHandler<dim, spacedim> &mg_dof)
{
// Fill target component with
// standard values (identity) if it
}
+
template <typename number>
template <int dim, int spacedim>
void
MGTransferSelect<number>::build_matrices(
- const DoFHandler<dim, spacedim> & dof,
+ const DoFHandler<dim, spacedim> & /*dof*/,
+ const DoFHandler<dim, spacedim> & mg_dof,
+ unsigned int select,
+ unsigned int mg_select,
+ const std::vector<unsigned int> & t_component,
+ const std::vector<unsigned int> & mg_t_component,
+ const std::vector<std::set<types::global_dof_index>> &bdry_indices)
+{
+ build(mg_dof, select, mg_select, t_component, mg_t_component, bdry_indices);
+}
+
+
+
+template <typename number>
+template <int dim, int spacedim>
+void
+MGTransferSelect<number>::build(
const DoFHandler<dim, spacedim> & mg_dof,
unsigned int select,
unsigned int mg_select,
}
}
- MGTransferComponentBase::build_matrices(dof, mg_dof);
+ MGTransferComponentBase::build(mg_dof);
interface_dofs.resize(mg_dof.get_triangulation().n_levels());
for (unsigned int l = 0; l < mg_dof.get_triangulation().n_levels(); ++l)
std::vector<types::global_dof_index> temp_copy_indices;
std::vector<types::global_dof_index> global_dof_indices(fe.dofs_per_cell);
std::vector<types::global_dof_index> level_dof_indices(fe.dofs_per_cell);
- for (int level = dof.get_triangulation().n_levels() - 1; level >= 0; --level)
+ for (int level = mg_dof.get_triangulation().n_levels() - 1; level >= 0;
+ --level)
{
copy_to_and_from_indices[level].clear();
typename DoFHandler<dim, spacedim>::active_cell_iterator level_cell =
for (deal_II_dimension : DIMENSIONS)
{
+ template void MGTransferSelect<float>::build<deal_II_dimension>(
+ const DoFHandler<deal_II_dimension> &,
+ unsigned int,
+ unsigned int,
+ const std::vector<unsigned int> &,
+ const std::vector<unsigned int> &,
+ const std::vector<std::set<types::global_dof_index>> &);
+
+ template void MGTransferSelect<double>::build<deal_II_dimension>(
+ const DoFHandler<deal_II_dimension> &,
+ unsigned int,
+ unsigned int,
+ const std::vector<unsigned int> &,
+ const std::vector<unsigned int> &,
+ const std::vector<std::set<types::global_dof_index>> &);
+
+ // deprecated:
template void MGTransferSelect<float>::build_matrices<deal_II_dimension>(
const DoFHandler<deal_II_dimension> &d,
const DoFHandler<deal_II_dimension> &,
const std::vector<unsigned int> &,
const std::vector<std::set<types::global_dof_index>> &);
+ // deprecated:
template void MGTransferSelect<double>::build_matrices<deal_II_dimension>(
const DoFHandler<deal_II_dimension> &d,
const DoFHandler<deal_II_dimension> &,
template <int dim, int spacedim>
void
fill_copy_indices(
- const dealii::DoFHandler<dim, spacedim> &mg_dof,
+ const dealii::DoFHandler<dim, spacedim> &dof_handler,
const MGConstrainedDoFs * mg_constrained_dofs,
std::vector<std::vector<
std::pair<types::global_dof_index, types::global_dof_index>>>
std::vector<DoFPair> send_data_temp;
const unsigned int n_levels =
- mg_dof.get_triangulation().n_global_levels();
+ dof_handler.get_triangulation().n_global_levels();
copy_indices.resize(n_levels);
copy_indices_global_mine.resize(n_levels);
copy_indices_level_mine.resize(n_levels);
IndexSet globally_relevant;
- DoFTools::extract_locally_relevant_dofs(mg_dof, globally_relevant);
+ DoFTools::extract_locally_relevant_dofs(dof_handler, globally_relevant);
- const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell;
+ const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
std::vector<types::global_dof_index> global_dof_indices(dofs_per_cell);
std::vector<types::global_dof_index> level_dof_indices(dofs_per_cell);
copy_indices_global_mine[level].clear();
for (const auto &level_cell :
- mg_dof.active_cell_iterators_on_level(level))
+ dof_handler.active_cell_iterators_on_level(level))
{
- if (mg_dof.get_triangulation().locally_owned_subdomain() !=
+ if (dof_handler.get_triangulation().locally_owned_subdomain() !=
numbers::invalid_subdomain_id &&
(level_cell->level_subdomain_id() ==
numbers::artificial_subdomain_id ||
continue;
unrolled_copy_indices.resize(
- mg_dof.locally_owned_dofs().n_elements(),
+ dof_handler.locally_owned_dofs().n_elements(),
numbers::invalid_dof_index);
// get the dof numbers of this cell for the global and the
// and the level one. This check involves locally owned
// indices which often consist only of a single range, so
// they are cheap to look up.
- bool global_mine = mg_dof.locally_owned_dofs().is_element(
- global_dof_indices[i]);
+ bool global_mine =
+ dof_handler.locally_owned_dofs().is_element(
+ global_dof_indices[i]);
bool level_mine =
- mg_dof.locally_owned_mg_dofs(level).is_element(
+ dof_handler.locally_owned_mg_dofs(level).is_element(
level_dof_indices[i]);
if (global_mine && level_mine)
// we own both the active dof index and the level one ->
// set them into the vector, indexed by the local index
// range of the active dof
- unrolled_copy_indices[mg_dof.locally_owned_dofs()
+ unrolled_copy_indices[dof_handler.locally_owned_dofs()
.index_within_set(
global_dof_indices[i])] =
level_dof_indices[i];
// locally_owned_dofs().nth_index_in_set(i) in this query is
// usually cheap to look up as there are few ranges in
- // mg_dof.locally_owned_dofs()
+ // dof_handler.locally_owned_dofs()
for (unsigned int i = 0; i < unrolled_copy_indices.size(); ++i)
if (unrolled_copy_indices[i] != numbers::invalid_dof_index)
copy_indices[level].emplace_back(
- mg_dof.locally_owned_dofs().nth_index_in_set(i),
+ dof_handler.locally_owned_dofs().nth_index_in_set(i),
unrolled_copy_indices[i]);
}
}
const dealii::parallel::TriangulationBase<dim, spacedim> *tria =
(dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- &mg_dof.get_triangulation()));
+ &dof_handler.get_triangulation()));
AssertThrow(
send_data_temp.size() == 0 || tria != nullptr,
ExcMessage(
for (unsigned int level = 0; level < n_levels; ++level)
{
- const IndexSet &is_local = mg_dof.locally_owned_mg_dofs(level);
+ const IndexSet &is_local =
+ dof_handler.locally_owned_mg_dofs(level);
std::vector<unsigned int> level_dof_indices;
std::vector<unsigned int> global_dof_indices;
void
setup_element_info(ElementInfo<Number> & elem_info,
const FiniteElement<1> & fe,
- const dealii::DoFHandler<dim> &mg_dof)
+ const dealii::DoFHandler<dim> &dof_handler)
{
// currently, we have only FE_Q and FE_DGQ type elements implemented
- elem_info.n_components = mg_dof.get_fe().element_multiplicity(0);
+ elem_info.n_components = dof_handler.get_fe().element_multiplicity(0);
AssertDimension(Utilities::fixed_power<dim>(fe.dofs_per_cell) *
elem_info.n_components,
- mg_dof.get_fe().dofs_per_cell);
- AssertDimension(fe.degree, mg_dof.get_fe().degree);
+ dof_handler.get_fe().dofs_per_cell);
+ AssertDimension(fe.degree, dof_handler.get_fe().degree);
elem_info.fe_degree = fe.degree;
elem_info.element_is_continuous = fe.dofs_per_vertex > 0;
Assert(fe.dofs_per_vertex < 2, ExcNotImplemented());
const Quadrature<1> dummy_quadrature(
std::vector<Point<1>>(1, Point<1>()));
internal::MatrixFreeFunctions::ShapeInfo<Number> shape_info;
- shape_info.reinit(dummy_quadrature, mg_dof.get_fe(), 0);
+ shape_info.reinit(dummy_quadrature, dof_handler.get_fe(), 0);
elem_info.lexicographic_numbering = shape_info.lexicographic_numbering;
// step 1.4: get the 1d prolongation matrix and combine from both children
template <int dim, typename Number>
void
setup_transfer(
- const dealii::DoFHandler<dim> &mg_dof,
+ const dealii::DoFHandler<dim> &dof_handler,
const MGConstrainedDoFs * mg_constrained_dofs,
const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
& external_partitioners,
// tensorized operations, we align the degrees of freedom
// lexicographically. We distinguish FE_Q elements and FE_DGQ elements
- const dealii::Triangulation<dim> &tria = mg_dof.get_triangulation();
+ const dealii::Triangulation<dim> &tria = dof_handler.get_triangulation();
// ---------------------------- 1. Extract 1D info about the finite
// element step 1.1: create a 1D copy of the finite element from FETools
// where we substitute the template argument
- AssertDimension(mg_dof.get_fe().n_base_elements(), 1);
- std::string fe_name = mg_dof.get_fe().base_element(0).get_name();
+ AssertDimension(dof_handler.get_fe().n_base_elements(), 1);
+ std::string fe_name = dof_handler.get_fe().base_element(0).get_name();
{
const std::size_t template_starts = fe_name.find_first_of('<');
Assert(fe_name[template_starts + 1] ==
const std::unique_ptr<FiniteElement<1>> fe(
FETools::get_fe_by_name<1, 1>(fe_name));
- setup_element_info(elem_info, *fe, mg_dof);
+ setup_element_info(elem_info, *fe, dof_handler);
// -------------- 2. Extract and match dof indices between child and
coarse_level_indices[level].resize(tria.n_raw_cells(level),
numbers::invalid_unsigned_int);
std::vector<types::global_dof_index> local_dof_indices(
- mg_dof.get_fe().dofs_per_cell);
+ dof_handler.get_fe().dofs_per_cell);
dirichlet_indices.resize(n_levels - 1);
AssertDimension(target_partitioners.max_level(), n_levels - 1);
// step 2.1: loop over the cells on the coarse side
typename dealii::DoFHandler<dim>::cell_iterator cell,
- endc = mg_dof.end(level - 1);
- for (cell = mg_dof.begin(level - 1); cell != endc; ++cell)
+ endc = dof_handler.end(level - 1);
+ for (cell = dof_handler.begin(level - 1); cell != endc; ++cell)
{
// need to look into a cell if it has children and it is locally
// owned
replace(mg_constrained_dofs, level, local_dof_indices);
const IndexSet &owned_level_dofs =
- mg_dof.locally_owned_mg_dofs(level);
+ dof_handler.locally_owned_mg_dofs(level);
for (const auto local_dof_index : local_dof_indices)
if (!owned_level_dofs.is_element(local_dof_index))
ghosted_level_dofs.push_back(local_dof_index);
tria.n_cells(level);
parent_child_connect[level][child_index] =
std::make_pair(parent_index, c);
- AssertIndexRange(mg_dof.get_fe().dofs_per_cell,
+ AssertIndexRange(dof_handler.get_fe().dofs_per_cell,
static_cast<unsigned short>(-1));
// set Dirichlet boundary conditions (as a list of
// constrained DoFs) for the child
if (mg_constrained_dofs != nullptr)
for (unsigned int i = 0;
- i < mg_dof.get_fe().dofs_per_cell;
+ i < dof_handler.get_fe().dofs_per_cell;
++i)
if (mg_constrained_dofs->is_boundary_index(
level,
replace(mg_constrained_dofs, level - 1, local_dof_indices);
const IndexSet &owned_level_dofs_l0 =
- mg_dof.locally_owned_mg_dofs(0);
+ dof_handler.locally_owned_mg_dofs(0);
for (const auto local_dof_index : local_dof_indices)
if (!owned_level_dofs_l0.is_element(local_dof_index))
ghosted_level_dofs_l0.push_back(local_dof_index);
dirichlet_indices[0].emplace_back();
if (mg_constrained_dofs != nullptr)
- for (unsigned int i = 0; i < mg_dof.get_fe().dofs_per_cell;
+ for (unsigned int i = 0;
+ i < dof_handler.get_fe().dofs_per_cell;
++i)
if (mg_constrained_dofs->is_boundary_index(
0,
const MPI_Comm communicator =
ptria != nullptr ? ptria->get_communicator() : MPI_COMM_SELF;
- reinit_level_partitioner(mg_dof.locally_owned_mg_dofs(level),
+ reinit_level_partitioner(dof_handler.locally_owned_mg_dofs(level),
ghosted_level_dofs,
external_partitioners.empty() ?
nullptr :
for (unsigned int i = 0; i < parent_child_connect[0].size(); ++i)
parent_child_connect[0][i] = std::make_pair(i, 0U);
- reinit_level_partitioner(mg_dof.locally_owned_mg_dofs(0),
+ reinit_level_partitioner(dof_handler.locally_owned_mg_dofs(0),
ghosted_level_dofs_l0,
external_partitioners.empty() ?
nullptr :
template <int dim, typename Number>
void
MGTransferMatrixFree<dim, Number>::build(
- const DoFHandler<dim, dim> &mg_dof,
+ const DoFHandler<dim, dim> &dof_handler,
const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
&external_partitioners)
{
- this->fill_and_communicate_copy_indices(mg_dof);
+ this->fill_and_communicate_copy_indices(dof_handler);
vector_partitioners.resize(0,
- mg_dof.get_triangulation().n_global_levels() - 1);
+ dof_handler.get_triangulation().n_global_levels() -
+ 1);
for (unsigned int level = 0; level <= this->ghosted_level_vector.max_level();
++level)
vector_partitioners[level] =
internal::MGTransfer::ElementInfo<Number> elem_info;
internal::MGTransfer::setup_transfer<dim, Number>(
- mg_dof,
+ dof_handler,
this->mg_constrained_dofs,
external_partitioners,
elem_info,
// reshuffle into aligned vector of vectorized arrays
const unsigned int vec_size = VectorizedArray<Number>::n_array_elements;
- const unsigned int n_levels = mg_dof.get_triangulation().n_global_levels();
+ const unsigned int n_levels =
+ dof_handler.get_triangulation().n_global_levels();
const unsigned int n_weights_per_cell = Utilities::fixed_power<dim>(3);
weights_on_refined.resize(n_levels - 1);
template <int dim, typename Number>
void
MGTransferBlockMatrixFree<dim, Number>::build(
- const DoFHandler<dim, dim> &mg_dof)
+ const DoFHandler<dim, dim> &dof_handler)
{
AssertDimension(matrix_free_transfer_vector.size(), 1);
- matrix_free_transfer_vector[0].build(mg_dof);
+ matrix_free_transfer_vector[0].build(dof_handler);
}
template <int dim, typename Number>
void
MGTransferBlockMatrixFree<dim, Number>::build(
- const std::vector<const DoFHandler<dim, dim> *> &mg_dof)
+ const std::vector<const DoFHandler<dim, dim> *> &dof_handler)
{
- AssertDimension(matrix_free_transfer_vector.size(), mg_dof.size());
- for (unsigned int i = 0; i < mg_dof.size(); ++i)
- matrix_free_transfer_vector[i].build(*mg_dof[i]);
+ AssertDimension(matrix_free_transfer_vector.size(), dof_handler.size());
+ for (unsigned int i = 0; i < dof_handler.size(); ++i)
+ matrix_free_transfer_vector[i].build(*dof_handler[i]);
}
namespace
{
/**
- * Helper function for build_matrices. Checks for identity constrained dofs
+ * Helper function for build. Checks for identity constrained dofs
* and replace with the indices of the dofs to which they are constrained
*/
void
template <typename VectorType>
template <int dim, int spacedim>
void
-MGTransferPrebuilt<VectorType>::build_matrices(
- const DoFHandler<dim, spacedim> &mg_dof)
+MGTransferPrebuilt<VectorType>::build(
+ const DoFHandler<dim, spacedim> &dof_handler)
{
- const unsigned int n_levels = mg_dof.get_triangulation().n_global_levels();
- const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell;
+ const unsigned int n_levels =
+ dof_handler.get_triangulation().n_global_levels();
+ const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
this->sizes.resize(n_levels);
for (unsigned int l = 0; l < n_levels; ++l)
- this->sizes[l] = mg_dof.n_dofs(l);
+ this->sizes[l] = dof_handler.n_dofs(l);
// reset the size of the array of
// matrices. call resize(0) first,
// increment dofs_per_cell since a useless diagonal element will be
// stored
IndexSet level_p1_relevant_dofs;
- DoFTools::extract_locally_relevant_level_dofs(mg_dof,
+ DoFTools::extract_locally_relevant_level_dofs(dof_handler,
level + 1,
level_p1_relevant_dofs);
DynamicSparsityPattern dsp(this->sizes[level + 1],
this->sizes[level],
level_p1_relevant_dofs);
- typename DoFHandler<dim>::cell_iterator cell, endc = mg_dof.end(level);
- for (cell = mg_dof.begin(level); cell != endc; ++cell)
+ typename DoFHandler<dim>::cell_iterator cell,
+ endc = dof_handler.end(level);
+ for (cell = dof_handler.begin(level); cell != endc; ++cell)
if (cell->has_children() &&
- (mg_dof.get_triangulation().locally_owned_subdomain() ==
+ (dof_handler.get_triangulation().locally_owned_subdomain() ==
numbers::invalid_subdomain_id ||
cell->level_subdomain_id() ==
- mg_dof.get_triangulation().locally_owned_subdomain()))
+ dof_handler.get_triangulation().locally_owned_subdomain()))
{
cell->get_mg_dof_indices(dof_indices_parent);
{
// set an alias to the prolongation matrix for this child
const FullMatrix<double> &prolongation =
- mg_dof.get_fe().get_prolongation_matrix(
+ dof_handler.get_fe().get_prolongation_matrix(
child, cell->refinement_case());
Assert(prolongation.n() != 0, ExcNoProlongation());
// Retrieve communicator from triangulation if it is parallel
const parallel::TriangulationBase<dim, spacedim> *dist_tria =
dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
- &(mg_dof.get_triangulation()));
+ &(dof_handler.get_triangulation()));
MPI_Comm communicator = dist_tria != nullptr ?
dist_tria->get_communicator() :
// Compute # of locally owned MG dofs / processor for distribution
const std::vector<::dealii::IndexSet>
locally_owned_mg_dofs_per_processor =
- mg_dof.compute_locally_owned_mg_dofs_per_processor(level + 1);
+ dof_handler.compute_locally_owned_mg_dofs_per_processor(level +
+ 1);
std::vector<::dealii::types::global_dof_index>
n_locally_owned_mg_dofs_per_processor(
locally_owned_mg_dofs_per_processor.size(), 0);
*prolongation_sparsities[level],
level,
dsp,
- mg_dof);
+ dof_handler);
dsp.reinit(0, 0);
// In the end, the entries in this object will only be real valued.
FullMatrix<typename VectorType::value_type> prolongation;
// now actually build the matrices
- for (cell = mg_dof.begin(level); cell != endc; ++cell)
+ for (cell = dof_handler.begin(level); cell != endc; ++cell)
if (cell->has_children() &&
- (mg_dof.get_triangulation().locally_owned_subdomain() ==
+ (dof_handler.get_triangulation().locally_owned_subdomain() ==
numbers::invalid_subdomain_id ||
cell->level_subdomain_id() ==
- mg_dof.get_triangulation().locally_owned_subdomain()))
+ dof_handler.get_triangulation().locally_owned_subdomain()))
{
cell->get_mg_dof_indices(dof_indices_parent);
for (unsigned int child = 0; child < cell->n_children(); ++child)
{
// set an alias to the prolongation matrix for this child
- prolongation = mg_dof.get_fe().get_prolongation_matrix(
+ prolongation = dof_handler.get_fe().get_prolongation_matrix(
child, cell->refinement_case());
if (this->mg_constrained_dofs != nullptr &&
prolongation_matrices[level]->compress(VectorOperation::insert);
}
- this->fill_and_communicate_copy_indices(mg_dof);
+ this->fill_and_communicate_copy_indices(dof_handler);
+}
+
+
+
+template <typename VectorType>
+template <int dim, int spacedim>
+void
+MGTransferPrebuilt<VectorType>::build_matrices(
+ const DoFHandler<dim, spacedim> &dof_handler)
+{
+ build(dof_handler);
}
for (deal_II_dimension : DIMENSIONS; V1 : VECTORS_WITH_MATRIX)
{
+ template void MGTransferPrebuilt<V1>::build<deal_II_dimension>(
+ const DoFHandler<deal_II_dimension> &mg_dof);
+
template void MGTransferPrebuilt<V1>::build_matrices<deal_II_dimension>(
const DoFHandler<deal_II_dimension> &mg_dof);
}
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<Vector<double>> mg_transfer;
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
FullMatrix<float> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
// Transfer operators between levels
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(velocity_dof_handler);
+ mg_transfer.build(velocity_dof_handler);
// Setup coarse grid solver
FullMatrix<double> coarse_matrix;
dof.distribute_mg_dofs();
MGTransferPrebuilt<Vector<double>> transfer;
- transfer.build_matrices(dof);
+ transfer.build(dof);
unsigned int n_coarse = dof.n_dofs(level - 1);
unsigned int n_fine = dof.n_dofs(level);
mg_smoother.initialize(mg_matrices, smoother_data);
MGTransferMF<LevelMatrixType> mg_transfer(mg_matrices);
- mg_transfer.build_matrices(dof);
+ mg_transfer.build(dof);
mg::Matrix<LinearAlgebra::distributed::Vector<double>> mg_matrix(mg_matrices);
}
MGTransferPrebuiltMF<LevelMatrixType> mg_transfer(mg_matrices);
- mg_transfer.build_matrices(dof);
+ mg_transfer.build(dof);
MGCoarseIterative<LevelMatrixType, number> mg_coarse;
mg_coarse.initialize(mg_matrices[0]);
mg_interface_matrices[level].initialize(mg_matrices[level]);
MGTransferMF<LevelMatrixType> mg_transfer(mg_matrices, mg_constrained_dofs);
- mg_transfer.build_matrices(dof);
+ mg_transfer.build(dof);
MGCoarseIterative<LevelMatrixType, number> mg_coarse;
mg_coarse.initialize(mg_matrices[0]);
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<Vector<double>> mg_transfer;
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
MGCoarseGridHouseholder<float, Vector<double>> mg_coarse;
mg_coarse.initialize(coarse_matrix);
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
matrix_t &coarse_matrix = mg_matrices[0];
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
matrix_t coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
matrix_t coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
SolverCG<TrilinosWrappers::MPI::Vector> solver(control);
MGTransferPrebuilt<TrilinosWrappers::MPI::Vector> mg_transfer;
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
SolverControl coarse_solver_control(1000, 1e-10, false, false);
SolverCG<TrilinosWrappers::MPI::Vector> coarse_solver(
SolverCG<TrilinosWrappers::MPI::Vector> solver(control);
MGTransferPrebuilt<TrilinosWrappers::MPI::Vector> mg_transfer;
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
SolverControl coarse_solver_control(1000, 1e-10, false, false);
SolverCG<TrilinosWrappers::MPI::Vector> coarse_solver(
const MGCoarseGridBase<vector_t> &coarse_grid_solver)
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
typedef LA::MPI::PreconditionJacobi Smoother;
MGSmootherPrecondition<matrix_t, Smoother, vector_t> mg_smoother;
const MGCoarseGridBase<vector_t> &coarse_grid_solver)
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
typedef LA::MPI::PreconditionJacobi Smoother;
MGSmootherPrecondition<matrix_t, Smoother, vector_t> mg_smoother;
dirichlet_boundary_functions);
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
MGTransferPrebuilt<Vector<double>> transfer_renumbered(
mg_constrained_dofs_renumbered);
- transfer_renumbered.build_matrices(mgdof_renumbered);
+ transfer_renumbered.build(mgdof_renumbered);
Vector<double> u(mgdof.n_dofs());
initialize(mgdof, u);
dirichlet_boundary_functions);
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
MGTransferPrebuilt<Vector<double>> transfer_renumbered(
mg_constrained_dofs_renumbered);
- transfer_renumbered.build_matrices(mgdof_renumbered);
+ transfer_renumbered.build(mgdof_renumbered);
// Fill vector u with some cell based numbering
Vector<double> u(mgdof.n_dofs());
dirichlet_boundary);
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
MGTransferPrebuilt<Vector<double>> mg_transfer_renumbered(
mg_constrained_dofs_renumbered);
- mg_transfer_renumbered.build_matrices(mg_dof_handler_renumbered);
+ mg_transfer_renumbered.build(mg_dof_handler_renumbered);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
dirichlet_boundary);
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
MGTransferPrebuilt<Vector<double>> mg_transfer_renumbered(
mg_constrained_dofs_renumbered);
- mg_transfer_renumbered.build_matrices(mg_dof_handler_renumbered);
+ mg_transfer_renumbered.build(mg_dof_handler_renumbered);
Vector<double> test;
test.reinit(mg_dof_handler.n_dofs());
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[min_level]);
{
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>> mg_transfer(
mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
SolverControl coarse_solver_control(1000, 1e-10, false, false);
SolverCG<LinearAlgebra::distributed::Vector<double>> coarse_solver(
{
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>> mg_transfer(
hanging_node_constraints, mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
SolverControl coarse_solver_control(1000, 1e-10, false, false);
SolverCG<LinearAlgebra::distributed::Vector<double>> coarse_solver(
{
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>> mg_transfer(
hanging_node_constraints, mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
SolverControl coarse_solver_control(1000, 1e-10, false, false);
SolverCG<LinearAlgebra::distributed::Vector<double>> coarse_solver(
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
matrix_t &coarse_matrix = mg_matrices[0];
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
// pre and post smoothers:
typedef LA::MPI::PreconditionJacobi Smoother;
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
matrix_t &coarse_matrix = mg_matrices[0];
typedef Vector<double> vector_t;
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
matrix_t &coarse_matrix = mg_matrices[0];
LaplaceProblem<dim>::solve(bool use_mw)
{
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrices[0]);
SolverCG<Vector<double>> solver(control);
MGTransferPrebuilt<Vector<double>> mg_transfer;
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrix[0]);
SolverCG<Vector<double>> solver(control);
MGTransferPrebuilt<Vector<double>> mg_transfer;
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrix[0]);
SolverGMRES<Vector<double>> solver(control);
MGTransferPrebuilt<Vector<double>> mg_transfer;
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrix[0]);
SolverCG<Vector<double>> solver(control);
MGTransferPrebuilt<Vector<double>> mg_transfer;
- mg_transfer.build_matrices(dof_handler);
+ mg_transfer.build(dof_handler);
FullMatrix<double> coarse_matrix;
coarse_matrix.copy_from(mg_matrix[0]);
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
matrix_t &coarse_matrix = mg_matrices[0];
LaplaceProblem<dim>::solve()
{
MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
- mg_transfer.build_matrices(mg_dof_handler);
+ mg_transfer.build(mg_dof_handler);
matrix_t &coarse_matrix = mg_matrices[0];
mgdof.distribute_mg_dofs();
MGTransferPrebuilt<Vector<double>> transfer;
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
MGLevelObject<Vector<double>> u(0, tr.n_levels() - 1);
reinit_vector(mgdof, u);
mgdof.distribute_mg_dofs();
MGTransferPrebuilt<Vector<double>> transfer;
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
MGLevelObject<Vector<double>> u(0, tr.n_levels() - 1);
reinit_vector(mgdof, u);
DoFRenumbering::component_wise(mgdof_renumbered, level, block_component);
MGTransferPrebuilt<Vector<double>> transfer;
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
MGTransferPrebuilt<Vector<double>> transfer_renumbered;
- transfer_renumbered.build_matrices(mgdof_renumbered);
+ transfer_renumbered.build(mgdof_renumbered);
Vector<double> u(mgdof.n_dofs());
initialize(mgdof, u);
hanging_node_constraints.close();
MGTransferPrebuilt<vector_t> transfer(mg_constrained_dofs);
- transfer.build_matrices(dofh);
+ transfer.build(dofh);
// transfer.print_indices(deallog.get_file_stream());
MGLevelObject<vector_t> u(0, tr.n_global_levels() - 1);
typedef TrilinosWrappers::MPI::Vector vector_t;
{}
MGTransferPrebuilt<vector_t> transfer;
- transfer.build_matrices(dofh);
+ transfer.build(dofh);
transfer.print_indices(deallog.get_file_stream());
MGLevelObject<vector_t> u(0, tr.n_global_levels() - 1);
typedef PETScWrappers::MPI::Vector vector_t;
{}
MGTransferPrebuilt<vector_t> transfer;
- transfer.build_matrices(dofh);
+ transfer.build(dofh);
transfer.print_indices(deallog.get_file_stream());
MGLevelObject<vector_t> u(0, tr.n_global_levels() - 1);
GridGenerator::hyper_cube(tr);
tr.refine_global(2);
- DoFHandler<dim> mgdof(tr);
- DoFHandler<dim> &dof = mgdof;
+ DoFHandler<dim> mgdof(tr);
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
DoFRenumbering::component_wise(mgdof);
PrimitiveVectorMemory<Vector<double>> mem;
MGTransferBlock<double> transfer;
- transfer.build_matrices(dof, mgdof, selected);
+ transfer.build(mgdof, selected);
if (factors.size() > 0)
transfer.initialize(factors, mem);
GridGenerator::hyper_cube(tr);
tr.refine_global(2);
- DoFHandler<dim> mgdof(tr);
- DoFHandler<dim> &dof = mgdof;
+ DoFHandler<dim> mgdof(tr);
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
DoFRenumbering::component_wise(mgdof);
}
MGTransferBlockSelect<double> transfer;
- transfer.build_matrices(dof, mgdof, selected);
+ transfer.build(mgdof, selected);
// First, prolongate the constant
// function from the coarsest mesh
GridGenerator::hyper_cube(tr);
tr.refine_global(2);
- DoFHandler<dim> mgdof(tr);
- DoFHandler<dim> &dof = mgdof;
+ DoFHandler<dim> mgdof(tr);
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
Tensor<1, dim> direction;
for (unsigned int d = 0; d < dim; ++d)
direction[d] = d * d * d;
- DoFRenumbering::downstream(dof, direction);
- DoFRenumbering::component_wise(dof);
+ DoFRenumbering::downstream(mgdof, direction);
+ DoFRenumbering::component_wise(mgdof);
for (unsigned int l = 0; l < tr.n_levels(); ++l)
{
DoFRenumbering::downstream(mgdof, l, direction);
MGTransferPrebuilt<BlockVector<double>> transfer;
MGTransferBlock<double> transfer_block;
MGTransferBlockSelect<double> transfer_select;
- transfer.build_matrices(mgdof);
- transfer_block.build_matrices(dof, mgdof, selected);
- transfer_select.build_matrices(dof, mgdof, 0);
+ transfer.build(mgdof);
+ transfer_block.build(mgdof, selected);
+ transfer_select.build(mgdof, 0);
BlockVector<double> u2(mg_ndofs[2]);
BlockVector<double> u1(mg_ndofs[1]);
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
transfer_ref(mg_constrained_dofs);
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
// build matrix-free transfer
MGTransferMatrixFree<dim, Number> transfer(mg_constrained_dofs);
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
transfer_ref(mg_constrained_dofs);
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
// build matrix-free transfer
MGTransferMatrixFree<dim, Number> transfer(mg_constrained_dofs);
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
transfer_ref(mg_constrained_dofs);
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
// build matrix-free transfer
MGTransferMatrixFree<dim, Number> transfer(mg_constrained_dofs);
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
transfer_ref;
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
// build matrix-free transfer
MGTransferMatrixFree<dim, Number> transfer;
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
transfer_ref;
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
// build matrix-free transfer
MGTransferMatrixFree<dim, Number> transfer;
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
transfer_ref(mg_constrained_dofs);
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
// build matrix-free transfer
MGTransferMatrixFree<dim, Number> transfer(mg_constrained_dofs);
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
transfer_ref;
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
// build matrix-free transfer
MGTransferMatrixFree<dim, Number> transfer;
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>> transfer_ref(
mg_constrained_dofs);
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
deallog << "Transfer matrices: " << std::endl;
transfer_ref.print_matrices(deallog.get_file_stream());
deallog << std::endl;
mgdof.distribute_mg_dofs();
MGTransferPrebuilt<Vector<double>> transfer;
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
transfer.print_matrices(deallog.get_file_stream());
transfer.print_indices(deallog.get_file_stream());
mg_constrained_dofs.initialize(mgdof);
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
transfer.print_matrices(deallog.get_file_stream());
transfer.print_indices(deallog.get_file_stream());
mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
transfer.print_matrices(deallog.get_file_stream());
transfer.print_indices(deallog.get_file_stream());
// create this if we have Trilinos
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
transfer_ref(mg_constrained_dofs);
- transfer_ref.build_matrices(mgdof);
+ transfer_ref.build(mgdof);
}
#endif
{
GridGenerator::hyper_cube(tr);
tr.refine_global(2);
- DoFHandler<dim> mgdof(tr);
- DoFHandler<dim> &dof = mgdof;
+ DoFHandler<dim> mgdof(tr);
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
DoFRenumbering::component_wise(mgdof, target_component);
vector<types::global_dof_index> ndofs(
*std::max_element(target_component.begin(), target_component.end()) + 1);
- DoFTools::count_dofs_per_component(dof, ndofs, true, target_component);
+ DoFTools::count_dofs_per_component(mgdof, ndofs, true, target_component);
for (unsigned int l = 0; l < tr.n_levels(); ++l)
DoFRenumbering::component_wise(mgdof, l, mg_target_component);
MGTransferSelect<double> transfer;
- transfer.build_matrices(
- dof, mgdof, selected, mg_selected, target_component, mg_target_component);
+ transfer.build(
+ mgdof, selected, mg_selected, target_component, mg_target_component);
Vector<double> u2(mg_ndofs[2][mg_selected]);
Vector<double> u1(mg_ndofs[1][mg_selected]);
DoFRenumbering::component_wise(mg_dof_handler, level);
MGTransferPrebuilt<Vector<double>> transfer;
- transfer.build_matrices(mg_dof_handler);
+ transfer.build(mg_dof_handler);
FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
mg_dof_handler.n_dofs(0));
// group all components into one
// block, and do the transfer
// matrices on this block
- transfer.build_matrices(mg_dof_handler,
- mg_dof_handler,
- 0,
- 0,
- std::vector<unsigned int>(2, 0U),
- std::vector<unsigned int>(2, 0U));
+ transfer.build(mg_dof_handler,
+ 0,
+ 0,
+ std::vector<unsigned int>(2, 0U),
+ std::vector<unsigned int>(2, 0U));
FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
mg_dof_handler.n_dofs(0));
std::vector<unsigned int> mask(2);
mask[0] = 0;
mask[1] = 1;
- transfer.build_matrices(mg_dof_handler, mg_dof_handler, 0, 0, mask, mask);
+ transfer.build(mg_dof_handler, 0, 0, mask, mask);
// use only the first half of all
// components
MGTransferSelect<double> transfer;
- transfer.build_matrices(
- mg_dof_handler, mg_dof_handler, 0, 0, block_component, block_component);
+ transfer.build(mg_dof_handler, 0, 0, block_component, block_component);
std::vector<std::vector<types::global_dof_index>> dofs_per_block(
tr.n_levels(), std::vector<types::global_dof_index>(2));
MGTransferSelect<double> transfer;
- transfer.build_matrices(mg_dof_handler,
- mg_dof_handler,
- selected_block,
- selected_block,
- block_component,
- block_component);
+ transfer.build(mg_dof_handler,
+ selected_block,
+ selected_block,
+ block_component,
+ block_component);
std::vector<types::global_dof_index> dofs_per_block(3);
DoFTools::count_dofs_per_block(mg_dof_handler,
DoFRenumbering::component_wise(mg_dof_handler, level);
MGTransferPrebuilt<Vector<double>> transfer;
- transfer.build_matrices(mg_dof_handler);
+ transfer.build(mg_dof_handler);
FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
mg_dof_handler.n_dofs(0));
mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary);
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
- transfer.build_matrices(mg_dof_handler);
+ transfer.build(mg_dof_handler);
FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
mg_dof_handler.n_dofs(0));
std::vector<unsigned int> block_selected(2, 0U);
MGTransferSelect<double> transfer;
- transfer.build_matrices(
- mg_dof_handler, mg_dof_handler, 0, 0, block_selected, block_selected);
+ transfer.build(mg_dof_handler, 0, 0, block_selected, block_selected);
FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
mg_dof_handler.n_dofs(0));
std::vector<unsigned int> block_selected(2, 0U);
MGTransferSelect<double> transfer;
- transfer.build_matrices(mg_dof_handler,
- mg_dof_handler,
- 0,
- 0,
- block_selected,
- block_selected,
- boundary_indices);
+ transfer.build(
+ mg_dof_handler, 0, 0, block_selected, block_selected, boundary_indices);
FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
mg_dof_handler.n_dofs(0));
block_selected[0] = 0;
block_selected[1] = 1;
MGTransferSelect<double> transfer;
- transfer.build_matrices(
- mg_dof_handler, mg_dof_handler, 0, 0, block_selected, block_selected);
+ transfer.build(mg_dof_handler, 0, 0, block_selected, block_selected);
// use only the first half of all
// components
block_selected[0] = 0;
block_selected[1] = 1;
MGTransferSelect<double> transfer;
- transfer.build_matrices(mg_dof_handler,
- mg_dof_handler,
- 0,
- 0,
- block_selected,
- block_selected,
- boundary_indices);
+ transfer.build(
+ mg_dof_handler, 0, 0, block_selected, block_selected, boundary_indices);
// use only the first half of all
// components
DoFRenumbering::component_wise(mg_dof_handler, level, block_selected);
MGTransferSelect<double> transfer;
- transfer.build_matrices(
- mg_dof_handler, mg_dof_handler, 0, 0, block_selected, block_selected);
+ transfer.build(mg_dof_handler, 0, 0, block_selected, block_selected);
std::vector<std::vector<types::global_dof_index>> dofs_per_block(
tr.n_levels(), std::vector<types::global_dof_index>(2));
boundary_indices);
MGTransferSelect<double> transfer;
- transfer.build_matrices(mg_dof_handler,
- mg_dof_handler,
- 0,
- 0,
- block_selected,
- block_selected,
- boundary_indices);
+ transfer.build(
+ mg_dof_handler, 0, 0, block_selected, block_selected, boundary_indices);
std::vector<std::vector<types::global_dof_index>> dofs_per_block(
tr.n_levels(), std::vector<types::global_dof_index>(2));
MGTransferSelect<double> transfer;
- transfer.build_matrices(mg_dof_handler,
- mg_dof_handler,
- selected_block,
- selected_block,
- block_component,
- block_component);
+ transfer.build(mg_dof_handler,
+ selected_block,
+ selected_block,
+ block_component,
+ block_component);
std::vector<types::global_dof_index> dofs_per_block(3);
DoFTools::count_dofs_per_block(mg_dof_handler,
mgdof.distribute_mg_dofs();
MGTransferPrebuilt<TrilinosWrappers::MPI::Vector> transfer;
- transfer.build_matrices(mgdof);
+ transfer.build(mgdof);
MGLevelObject<TrilinosWrappers::MPI::Vector> u(0, tr.n_levels() - 1);
reinit_vector(mgdof, u);