*
* @ingroup mg
*/
-class MGConstraints : public Subscriptor
+class MGConstrainedDoFs : public Subscriptor
{
public:
/**
template <int dim, int spacedim>
inline
void
-MGConstraints::initialize(const MGDoFHandler<dim,spacedim>& dof)
+MGConstrainedDoFs::initialize(const MGDoFHandler<dim,spacedim>& dof)
{
+ const unsigned int nlevels = dof.get_tria().n_levels();
+ refinement_edge_indices.resize(nlevels);
+ refinement_edge_boundary_indices.resize(nlevels);
+ for(unsigned int l=0; l<nlevels; ++l)
+ {
+ refinement_edge_indices[l].resize(dof.n_dofs(l));
+ refinement_edge_boundary_indices[l].resize(dof.n_dofs(l));
+ }
MGTools::extract_inner_interface_dofs (dof, refinement_edge_indices,
refinement_edge_boundary_indices);
}
template <int dim, int spacedim>
inline
void
-MGConstraints::initialize(
+MGConstrainedDoFs::initialize(
const MGDoFHandler<dim,spacedim>& dof,
const typename FunctionMap<dim>::type& function_map,
const std::vector<bool>& component_mask)
inline
void
-MGConstraints::clear()
+MGConstrainedDoFs::clear()
{
for(unsigned int l=0; l<boundary_indices.size(); ++l)
boundary_indices[l].clear();
inline
bool
-MGConstraints::is_boundary_index (const unsigned int level,
+MGConstrainedDoFs::is_boundary_index (const unsigned int level,
const unsigned int index) const
{
AssertIndexRange(level, boundary_indices.size());
inline
bool
-MGConstraints::at_refinement_edge (const unsigned int level,
+MGConstrainedDoFs::at_refinement_edge (const unsigned int level,
const unsigned int index) const
{
AssertIndexRange(level, refinement_edge_indices.size());
inline
bool
-MGConstraints::at_refinement_edge_boundary (const unsigned int level,
+MGConstrainedDoFs::at_refinement_edge_boundary (const unsigned int level,
const unsigned int index) const
{
AssertIndexRange(level, refinement_edge_boundary_indices.size());
inline
const std::vector<std::set<unsigned int> > &
-MGConstraints::get_boundary_indices () const
+MGConstrainedDoFs::get_boundary_indices () const
{
return boundary_indices;
}
inline
const std::vector<std::vector<bool> > &
-MGConstraints::get_refinement_edge_indices () const
+MGConstrainedDoFs::get_refinement_edge_indices () const
{
return refinement_edge_indices;
}
inline
const std::vector<std::vector<bool> > &
-MGConstraints::get_refinement_edge_boundary_indices () const
+MGConstrainedDoFs::get_refinement_edge_boundary_indices () const
{
return refinement_edge_boundary_indices;
}
#include <lac/vector_memory.h>
#include <multigrid/mg_base.h>
-#include <multigrid/mg_constraints.h>
+#include <multigrid/mg_constrained_dofs.h>
#include <base/mg_level_object.h>
* refinement.
*/
MGTransferPrebuilt ();
-
/**
- * Constructor with constraint matrices.
+ * Constructor with constraint matrices as well as mg_constrained_dofs.
*/
- MGTransferPrebuilt (const ConstraintMatrix& constraints);
+ MGTransferPrebuilt (const ConstraintMatrix& constraints,
+ const MGConstrainedDoFs& mg_constrained_dofs);
/**
* Destructor.
*/
* matrices for each level.
*/
template <int dim, int spacedim>
- void build_matrices (const MGDoFHandler<dim,spacedim> &mg_dof,
- const MGConstraints& mg_constraints);
+ void build_matrices (const MGDoFHandler<dim,spacedim> &mg_dof);
virtual void prolongate (const unsigned int to_level,
VECTOR &dst,
* The constraints of the global
* system.
*/
- SmartPointer<const ConstraintMatrix> constraints;
+ SmartPointer<const ConstraintMatrix, MGTransferPrebuilt<VECTOR> > constraints;
+ /**
+ * The mg_constrained_dofs of the level
+ * systems.
+ */
+
+ SmartPointer<const MGConstrainedDoFs, MGTransferPrebuilt<VECTOR> > mg_constrained_dofs;
};