]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Eliminate unused ConstraintMatrix objects in MGTransfer
authorDaniel Arndt <d.arndt@math.uni-goettingen.de>
Thu, 22 Sep 2016 20:24:33 +0000 (22:24 +0200)
committerDaniel Arndt <d.arndt@math.uni-goettingen.de>
Thu, 22 Sep 2016 20:24:33 +0000 (22:24 +0200)
include/deal.II/multigrid/mg_transfer.h
include/deal.II/multigrid/mg_transfer_block.h
source/multigrid/mg_transfer_prebuilt.cc
source/multigrid/multigrid.cc

index 4712d6fe55fcc9c2677fb5d94aa6b956437daa37..ccf66c5cc61f564dfa4c7194602df423df7e76a1 100644 (file)
@@ -443,8 +443,16 @@ public:
    * Constructor with constraints. Equivalent to the default constructor
    * followed by initialize_constraints().
    */
+  MGTransferPrebuilt (const MGConstrainedDoFs &mg_constrained_dofs);
+
+  /**
+   * Constructor with constraints. Equivalent to the default constructor
+   * followed by initialize_constraints().
+   *
+   * @deprecated @p constraints is unused.
+   */
   MGTransferPrebuilt (const ConstraintMatrix &constraints,
-                      const MGConstrainedDoFs &mg_constrained_dofs);
+                      const MGConstrainedDoFs &mg_constrained_dofs) DEAL_II_DEPRECATED;
 
   /**
    * Destructor.
@@ -454,8 +462,15 @@ public:
   /**
    * Initialize the constraints to be used in build_matrices().
    */
+  void initialize_constraints (const MGConstrainedDoFs &mg_constrained_dofs);
+
+  /**
+   * Initialize the constraints to be used in build_matrices().
+   *
+   * @deprecated @p constraints is unused.
+   */
   void initialize_constraints (const ConstraintMatrix &constraints,
-                               const MGConstrainedDoFs &mg_constrained_dofs);
+                               const MGConstrainedDoFs &mg_constrained_dofs) DEAL_II_DEPRECATED;
 
   /**
    * Reset the object to the state it had right after the default constructor.
@@ -541,11 +556,6 @@ private:
    * boundary.
    */
   std::vector<std::vector<bool> > interface_dofs;
-
-  /**
-   * The constraints of the global system.
-   */
-  SmartPointer<const ConstraintMatrix, MGTransferPrebuilt<VectorType> > constraints;
 };
 
 
index b992cf9c86ddac5cecd804682081b995b1f1d2a8..c75c9db1df894ade1622f8e05097293114cfd24b 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2001 - 2015 by the deal.II authors
+// Copyright (C) 2001 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -65,11 +65,20 @@ public:
    * discontinuous finite elements or with no local refinement.
    */
   MGTransferBlockBase ();
+
   /**
    * Constructor with constraint matrices as well as mg_constrained_dofs.
    */
+  MGTransferBlockBase (const MGConstrainedDoFs &mg_constrained_dofs);
+
+  /**
+   * Constructor with constraint matrices as well as mg_constrained_dofs.
+   *
+   * @deprecated @p constraints is unused.
+   */
   MGTransferBlockBase (const ConstraintMatrix &constraints,
-                       const MGConstrainedDoFs &mg_constrained_dofs);
+                       const MGConstrainedDoFs &mg_constrained_dofs) DEAL_II_DEPRECATED;
+
   /**
    * Memory used by this object.
    */
@@ -150,10 +159,7 @@ protected:
    */
   std::vector<std::vector<std::vector<std::pair<unsigned int, unsigned int> > > >
   copy_indices;
-  /**
-   * The constraints of the global system.
-   */
-  SmartPointer<const ConstraintMatrix, MGTransferBlockBase> constraints;
+
   /**
    * The mg_constrained_dofs of the level systems.
    */
@@ -299,11 +305,20 @@ public:
    * discontinuous finite elements or with no local refinement.
    */
   MGTransferBlockSelect ();
+
+  /**
+   * Constructor with constraint matrices as well as mg_constrained_dofs.
+   */
+  MGTransferBlockSelect (const MGConstrainedDoFs &mg_constrained_dofs);
+
   /**
    * Constructor with constraint matrices as well as mg_constrained_dofs.
+   *
+   * @deprecated @p constraints is unused.
    */
   MGTransferBlockSelect (const ConstraintMatrix &constraints,
-                         const MGConstrainedDoFs &mg_constrained_dofs);
+                         const MGConstrainedDoFs &mg_constrained_dofs) DEAL_II_DEPRECATED;
+
   /**
    * Destructor.
    */
index 95c6d32a65126b48feccf2457844f6e4edcd8623..377bfa6b7c360cc3a1574db256cbf551844ed3d9 100644 (file)
@@ -48,9 +48,15 @@ MGTransferPrebuilt<VectorType>::MGTransferPrebuilt ()
 
 
 template<typename VectorType>
-MGTransferPrebuilt<VectorType>::MGTransferPrebuilt (const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c)
-  :
-  constraints(&c)
+MGTransferPrebuilt<VectorType>::MGTransferPrebuilt (const MGConstrainedDoFs &mg_c)
+{
+  this->mg_constrained_dofs = &mg_c;
+}
+
+
+
+template<typename VectorType>
+MGTransferPrebuilt<VectorType>::MGTransferPrebuilt (const ConstraintMatrix &/*c*/, const MGConstrainedDoFs &mg_c)
 {
   this->mg_constrained_dofs = &mg_c;
 }
@@ -65,14 +71,22 @@ MGTransferPrebuilt<VectorType>::~MGTransferPrebuilt ()
 
 template <typename VectorType>
 void MGTransferPrebuilt<VectorType>::initialize_constraints
-(const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c)
+(const MGConstrainedDoFs &mg_c)
 {
-  constraints = &c;
   this->mg_constrained_dofs = &mg_c;
 }
 
 
 
+template <typename VectorType>
+void MGTransferPrebuilt<VectorType>::initialize_constraints
+(const ConstraintMatrix &/*c*/, const MGConstrainedDoFs &mg_c)
+{
+  initialize_constraints(mg_c);
+}
+
+
+
 template <typename VectorType>
 void MGTransferPrebuilt<VectorType>::clear ()
 {
@@ -80,7 +94,6 @@ void MGTransferPrebuilt<VectorType>::clear ()
   prolongation_matrices.resize(0);
   prolongation_sparsities.resize(0);
   interface_dofs.resize(0);
-  constraints = 0;
 }
 
 
index dd69a7a25d9c4e9194c22f8e084802771446106c..85118e18c8520f30d3e02904ab393d047311a4e3 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2000 - 2014 by the deal.II authors
+// Copyright (C) 2000 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -39,10 +39,18 @@ MGTransferBlockBase::MGTransferBlockBase ()
 {}
 
 
+
+MGTransferBlockBase::MGTransferBlockBase (
+  const MGConstrainedDoFs &mg_c)
+  :
+  mg_constrained_dofs(&mg_c)
+{}
+
+
+
 MGTransferBlockBase::MGTransferBlockBase (
-  const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c)
+  const ConstraintMatrix &/*c*/, const MGConstrainedDoFs &mg_c)
   :
-  constraints(&c),
   mg_constrained_dofs(&mg_c)
 {}
 
@@ -218,6 +226,7 @@ void MGTransferSelect<number>::prolongate (
 }
 
 
+
 template <typename number>
 void MGTransferSelect<number>::restrict_and_add (
   const unsigned int   from_level,
@@ -240,17 +249,29 @@ MGTransferBlockSelect<number>::MGTransferBlockSelect ()
 {}
 
 
+
 template <typename number>
 MGTransferBlockSelect<number>::MGTransferBlockSelect (
-  const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c)
-  : MGTransferBlockBase(c, mg_c)
+  const MGConstrainedDoFs &mg_c)
+  : MGTransferBlockBase(mg_c)
 {}
 
+
+
+template <typename number>
+MGTransferBlockSelect<number>::MGTransferBlockSelect (
+  const ConstraintMatrix &/*c*/, const MGConstrainedDoFs &mg_c)
+  : MGTransferBlockBase(mg_c)
+{}
+
+
+
 template <typename number>
 MGTransferBlockSelect<number>::~MGTransferBlockSelect ()
 {}
 
 
+
 template <typename number>
 void MGTransferBlockSelect<number>::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.