/* ---------------------------------------------------------------------
*
- * Copyright (C) 2003 - 2015 by the deal.II authors
+ * Copyright (C) 2003 - 2016 by the deal.II authors
*
* This file is part of the deal.II library.
*
SparsityPattern sparsity_pattern;
SparseMatrix<double> system_matrix;
- // We need an additional object for the hanging nodes constraints. They
- // are handed to the transfer object in the multigrid. Since we call a
- // compress inside the multigrid these constraints are not allowed to be
- // inhomogeneous so we store them in different ConstraintMatrix objects.
- ConstraintMatrix hanging_node_constraints;
ConstraintMatrix constraints;
Vector<double> solution;
system_rhs.reinit (dof_handler.n_dofs());
constraints.clear ();
- hanging_node_constraints.clear ();
- DoFTools::make_hanging_node_constraints (dof_handler, hanging_node_constraints);
DoFTools::make_hanging_node_constraints (dof_handler, constraints);
std::set<types::boundary_id> dirichlet_boundary_ids;
dirichlet_boundary_functions,
constraints);
constraints.close ();
- hanging_node_constraints.close ();
constraints.condense (dsp);
sparsity_pattern.copy_from (dsp);
system_matrix.reinit (sparsity_pattern);
template <int dim>
void LaplaceProblem<dim>::solve ()
{
- MGTransferPrebuilt<Vector<double> > mg_transfer(hanging_node_constraints, mg_constrained_dofs);
+ MGTransferPrebuilt<Vector<double> > mg_transfer(mg_constrained_dofs);
mg_transfer.build_matrices(dof_handler);
FullMatrix<double> coarse_matrix;
/* ---------------------------------------------------------------------
*
- * Copyright (C) 2003 - 2015 by the deal.II authors
+ * Copyright (C) 2003 - 2016 by the deal.II authors
*
* This file is part of the deal.II library.
*
IndexSet locally_relevant_set;
- ConstraintMatrix hanging_node_constraints;
ConstraintMatrix constraints;
vector_t solution;
// right away, without the need for a later
// clean-up stage:
constraints.reinit (locally_relevant_set);
- hanging_node_constraints.reinit (locally_relevant_set);
- DoFTools::make_hanging_node_constraints (mg_dof_handler, hanging_node_constraints);
DoFTools::make_hanging_node_constraints (mg_dof_handler, constraints);
std::set<types::boundary_id> dirichlet_boundary_ids;
dirichlet_boundary,
constraints);
constraints.close ();
- hanging_node_constraints.close ();
DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs());
DoFTools::make_sparsity_pattern (mg_dof_handler, dsp, constraints);
void LaplaceProblem<dim>::solve ()
{
// Create the object that deals with the transfer between
- // different refinement levels. We need to pass it the hanging
- // node constraints.
- MGTransferPrebuilt<vector_t> mg_transfer(hanging_node_constraints, mg_constrained_dofs);
+ // different refinement levels.
+ MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
// Now the prolongation matrix has to be built. This matrix needs
// to take the boundary values on each level into account and
// needs to know about the indices at the refinement edges. The
computing_timer.enter_subsection ("Solve - Set-up Preconditioner");
// Transfer operators between levels
- MGTransferPrebuilt<Vector<double> > mg_transfer(constraints, mg_constrained_dofs);
+ MGTransferPrebuilt<Vector<double> > mg_transfer(mg_constrained_dofs);
mg_transfer.build_matrices(velocity_dof_handler);
// Setup coarse grid solver