]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add functions for clearing and initializing an MGTransferPrebuilt object
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 2 Feb 2014 22:41:20 +0000 (22:41 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 2 Feb 2014 22:41:20 +0000 (22:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@32380 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/multigrid/mg_transfer.h
deal.II/source/multigrid/mg_transfer_prebuilt.cc

index 6d869a372074514841bc7a96fe536a4e87a74037..5edbbb6a39762c6ec166ab5329a622227dfa9e1a 100644 (file)
@@ -121,7 +121,8 @@ public:
    */
   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);
@@ -129,6 +130,18 @@ public:
    * 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.
index 00d449ad91b5329a918efa2f723004fd1efa60b6..f19388ce34a73862a154cbc6bd3602c0c111f37b 100644 (file)
@@ -56,11 +56,37 @@ MGTransferPrebuilt<VECTOR>::MGTransferPrebuilt (const ConstraintMatrix &c, const
   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,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.