*/
MGTransferPrebuilt ();
/**
- * Constructor with constraint matrices as well as mg_constrained_dofs.
+ * Constructor with constraints. Equivalent to the default
+ * constructor followed by initialize_constraints().
*/
MGTransferPrebuilt (const ConstraintMatrix &constraints,
const MGConstrainedDoFs &mg_constrained_dofs);
* Destructor.
*/
virtual ~MGTransferPrebuilt ();
+
+ /**
+ * Initialize the constraints to be used in build_matrices().
+ */
+ void initialize_constraints (const ConstraintMatrix &constraints,
+ const MGConstrainedDoFs &mg_constrained_dofs);
+
+ /**
+ * Reset the object to the state it had right after the default constructor.
+ */
+ void clear ();
+
/**
* Actually build the prolongation
* matrices for each level.
mg_constrained_dofs(&mg_c)
{}
+
template <class VECTOR>
MGTransferPrebuilt<VECTOR>::~MGTransferPrebuilt ()
{}
+template <class VECTOR>
+void MGTransferPrebuilt<VECTOR>::initialize_constraints (
+ const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c)
+{
+ constraints = &c;
+ mg_constrained_dofs = &mg_c;
+}
+
+
+template <class VECTOR>
+void MGTransferPrebuilt<VECTOR>::clear ()
+{
+ sizes.resize(0);
+ prolongation_matrices.resize(0);
+ prolongation_sparsities.resize(0);
+ copy_indices.resize(0);
+ copy_indices_to_me.resize(0);
+ copy_indices_from_me.resize(0);
+ component_to_block_map.resize(0);
+ interface_dofs.resize(0);
+ constraints = 0;
+ mg_constrained_dofs = 0;
+}
+
+
template <class VECTOR>
void MGTransferPrebuilt<VECTOR>::prolongate (
const unsigned int to_level,