* @author Wolfgang Bangerth, Guido Kanschat, 1999-2004
*/
template <class VECTOR>
-class MGTransferPrebuilt : public MGTransferBase<VECTOR>
+class MGTransferPrebuilt : public MGTransferBase<VECTOR>
{
public:
/**
OutVector& dst,
const MGLevelObject<VECTOR>& src) const;
+ /**
+ * If this object operates on
+ * BlockVector objects, we need
+ * to describe how the individual
+ * vector components are mapped
+ * to the blocks of a vector. For
+ * example, for a Stokes system,
+ * we have dim+1 vector
+ * components for velocity and
+ * pressure, but we may want to
+ * use block vectors with only
+ * two blocks for all velocities
+ * in one block, and the pressure
+ * variables in the other.
+ *
+ * By default, if this function
+ * is not called, block vectors
+ * have as many blocks as the
+ * finite element has vector
+ * components. However, this can
+ * be changed by calling this
+ * function with an array that
+ * describes how vector
+ * components are to be grouped
+ * into blocks. The meaning of
+ * the argument is the same as
+ * the one given to the
+ * DoFTools::count_dofs_per_component
+ * function.
+ */
+ void
+ set_component_to_block_map (const std::vector<unsigned int> &map);
+
/**
* Finite element does not
* provide prolongation matrices.
*/
DeclException0(ExcNoProlongation);
-
+
/**
* Call @p build_matrices
* function first.
* Memory used by this object.
*/
unsigned int memory_consumption () const;
-
+
private:
* while row indices belong to the
* child cell, i.e. the fine level.
*/
- std::vector<std_cxx1x::shared_ptr<SparseMatrix<double> > > prolongation_matrices;
-
+ std::vector<std_cxx1x::shared_ptr<SparseMatrix<double> > > prolongation_matrices;
+
/**
* Mapping for the
* <tt>copy_to/from_mg</tt>-functions.
std::vector<std::map<unsigned int, unsigned int> >
copy_indices;
+ /**
+ * The vector that stores what
+ * has been given to the
+ * set_component_to_block_map()
+ * function.
+ */
+ std::vector<unsigned int> component_to_block_map;
+
/**
* Fill the two boolean vectors
* #dofs_on_refinement_edge and
*
* @todo Clean up names
*/
- std::vector<std::vector<bool> > dofs_on_refinement_boundary;
+ std::vector<std::vector<bool> > dofs_on_refinement_boundary;
/**
* The constraints of the global
* system.
MGLevelObject<VECTOR>& dst,
const InVector& src) const
{
- internal::mg::reinit_vector(mg_dof_handler, dst);
+ internal::mg::reinit_vector(mg_dof_handler, component_to_block_map, dst);
bool first = true;
for (unsigned int level=mg_dof_handler.get_tria().n_levels();level != 0;)
{
dst(i->first) += src[level](i->second);
}
+
+
+template <class VECTOR>
+void
+MGTransferPrebuilt<VECTOR>::
+set_component_to_block_map (const std::vector<unsigned int> &map)
+{
+ component_to_block_map = map;
+}
+
+
+
template <class VECTOR>
template <int dim, int spacedim>
void MGTransferPrebuilt<VECTOR>::find_dofs_on_refinement_edges (