]> https://gitweb.dealii.org/ - dealii.git/commitdiff
RCM: Update matrix_free, part 3: matrix_free and dof_info
authorMatthias Maier <tamiko@43-1.org>
Sun, 27 May 2018 23:12:39 +0000 (18:12 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 6 Jun 2018 15:19:38 +0000 (10:19 -0500)
include/deal.II/matrix_free/dof_info.h
include/deal.II/matrix_free/dof_info.templates.h
include/deal.II/matrix_free/matrix_free.h
include/deal.II/matrix_free/matrix_free.templates.h

index f97710630d721a37187dde9d99f96efb100eda4a..0d815ad813fa87d12f3db01da4d8e3bdc9e9f6ed 100644 (file)
@@ -48,7 +48,7 @@ namespace internal
      * cells. Essentially, this is a smart number cache in the style of a
      * DoFHandler that also embeds the description of constraints directly on
      * the cell level without the need to refer to the external
-     * ConstraintMatrix.
+     * AffineConstraints object.
      *
      * This class only stores index relations. The weights for hanging node
      * constraints are stored in a different field. This is because a
@@ -110,11 +110,12 @@ namespace internal
        * assigned the correct index after all the ghost indices have been
        * collected by the call to @p assign_ghosts.
        */
+      template <typename number>
       void
       read_dof_indices(
         const std::vector<types::global_dof_index> &local_indices,
         const std::vector<unsigned int> &           lexicographic_inv,
-        const ConstraintMatrix &                    constraints,
+        const AffineConstraints<number> &           constraints,
         const unsigned int                          cell_number,
         ConstraintValues<double> &                  constraint_values,
         bool &                                      cell_at_boundary);
index 515ed576251b5e38b0c4389228cb83d6aa62bdb6..93d9de3a23bcfeebb6d57685bab771c619d79191 100644 (file)
@@ -170,11 +170,12 @@ namespace internal
 
 
 
+    template <typename number>
     void
     DoFInfo ::read_dof_indices(
       const std::vector<types::global_dof_index> &local_indices,
       const std::vector<unsigned int> &           lexicographic_inv,
-      const ConstraintMatrix &                    constraints,
+      const AffineConstraints<number> &           constraints,
       const unsigned int                          cell_number,
       ConstraintValues<double> &                  constraint_values,
       bool &                                      cell_at_subdomain_boundary)
index ce79cd6dfdc39c1ec06bf7fc6a959529aa3776e2..4048a4fbb564e1587a9fdd73c5f60ae219aa3af8 100644 (file)
@@ -476,22 +476,23 @@ public:
 
   /**
    * Extracts the information needed to perform loops over cells. The
-   * DoFHandler and ConstraintMatrix describe the layout of degrees of
-   * freedom, the DoFHandler and the mapping describe the transformations from
-   * unit to real cell, and the finite element underlying the DoFHandler
-   * together with the quadrature formula describe the local operations. Note
-   * that the finite element underlying the DoFHandler must either be scalar
-   * or contain several copies of the same element. Mixing several different
-   * elements into one FESystem is not allowed. In that case, use the
-   * initialization function with several DoFHandler arguments.
+   * DoFHandler and AffineConstraints objects describe the layout of degrees
+   * of freedom, the DoFHandler and the mapping describe the
+   * transformations from unit to real cell, and the finite element
+   * underlying the DoFHandler together with the quadrature formula
+   * describe the local operations. Note that the finite element underlying
+   * the DoFHandler must either be scalar or contain several copies of the
+   * same element. Mixing several different elements into one FESystem is
+   * not allowed. In that case, use the initialization function with
+   * several DoFHandler arguments.
    */
   template <typename DoFHandlerType, typename QuadratureType>
   void
-  reinit(const Mapping<dim> &    mapping,
-         const DoFHandlerType &  dof_handler,
-         const ConstraintMatrix &constraint,
-         const QuadratureType &  quad,
-         const AdditionalData    additional_data = AdditionalData());
+  reinit(const Mapping<dim> &             mapping,
+         const DoFHandlerType &           dof_handler,
+         const AffineConstraints<double> &constraint,
+         const QuadratureType &           quad,
+         const AdditionalData             additional_data = AdditionalData());
 
   /**
    * Initializes the data structures. Same as above, but using a $Q_1$
@@ -499,10 +500,10 @@ public:
    */
   template <typename DoFHandlerType, typename QuadratureType>
   void
-  reinit(const DoFHandlerType &  dof_handler,
-         const ConstraintMatrix &constraint,
-         const QuadratureType &  quad,
-         const AdditionalData    additional_data = AdditionalData());
+  reinit(const DoFHandlerType &           dof_handler,
+         const AffineConstraints<double> &constraint,
+         const QuadratureType &           quad,
+         const AdditionalData             additional_data = AdditionalData());
 
   /**
    * Same as above.
@@ -513,16 +514,16 @@ public:
    */
   template <typename DoFHandlerType, typename QuadratureType>
   DEAL_II_DEPRECATED void
-  reinit(const Mapping<dim> &    mapping,
-         const DoFHandlerType &  dof_handler,
-         const ConstraintMatrix &constraint,
-         const IndexSet &        locally_owned_dofs,
-         const QuadratureType &  quad,
-         const AdditionalData    additional_data = AdditionalData());
+  reinit(const Mapping<dim> &             mapping,
+         const DoFHandlerType &           dof_handler,
+         const AffineConstraints<double> &constraint,
+         const IndexSet &                 locally_owned_dofs,
+         const QuadratureType &           quad,
+         const AdditionalData             additional_data = AdditionalData());
 
   /**
    * Extracts the information needed to perform loops over cells. The
-   * DoFHandler and ConstraintMatrix describe the layout of degrees of
+   * DoFHandler and AffineConstraints objects describe the layout of degrees of
    * freedom, the DoFHandler and the mapping describe the transformations from
    * unit to real cell, and the finite element underlying the DoFHandler
    * together with the quadrature formula describe the local operations. As
@@ -531,8 +532,8 @@ public:
    * finite elements. The DoFHandlers to each element must be passed as
    * pointers to the initialization function. Note that the finite element
    * underlying an DoFHandler must either be scalar or contain several copies
-   * of the same element. Mixing several different elements into one @p
-   * FE_System is not allowed.
+   * of the same element. Mixing several different elements into one
+   * @p FE_System is not allowed.
    *
    * This function also allows for using several quadrature formulas, e.g.
    * when the description contains independent integrations of elements of
@@ -542,10 +543,10 @@ public:
    */
   template <typename DoFHandlerType, typename QuadratureType>
   void
-  reinit(const Mapping<dim> &                         mapping,
-         const std::vector<const DoFHandlerType *> &  dof_handler,
-         const std::vector<const ConstraintMatrix *> &constraint,
-         const std::vector<QuadratureType> &          quad,
+  reinit(const Mapping<dim> &                                  mapping,
+         const std::vector<const DoFHandlerType *> &           dof_handler,
+         const std::vector<const AffineConstraints<double> *> &constraint,
+         const std::vector<QuadratureType> &                   quad,
          const AdditionalData additional_data = AdditionalData());
 
   /**
@@ -554,9 +555,9 @@ public:
    */
   template <typename DoFHandlerType, typename QuadratureType>
   void
-  reinit(const std::vector<const DoFHandlerType *> &  dof_handler,
-         const std::vector<const ConstraintMatrix *> &constraint,
-         const std::vector<QuadratureType> &          quad,
+  reinit(const std::vector<const DoFHandlerType *> &           dof_handler,
+         const std::vector<const AffineConstraints<double> *> &constraint,
+         const std::vector<QuadratureType> &                   quad,
          const AdditionalData additional_data = AdditionalData());
 
   /**
@@ -568,12 +569,12 @@ public:
    */
   template <typename DoFHandlerType, typename QuadratureType>
   DEAL_II_DEPRECATED void
-  reinit(const Mapping<dim> &                         mapping,
-         const std::vector<const DoFHandlerType *> &  dof_handler,
-         const std::vector<const ConstraintMatrix *> &constraint,
-         const std::vector<IndexSet> &                locally_owned_set,
-         const std::vector<QuadratureType> &          quad,
-         const AdditionalData additional_data = AdditionalData());
+  reinit(const Mapping<dim> &                                  mapping,
+         const std::vector<const DoFHandlerType *> &           dof_handler,
+         const std::vector<const AffineConstraints<double> *> &constraint,
+         const std::vector<IndexSet> &      locally_owned_set,
+         const std::vector<QuadratureType> &quad,
+         const AdditionalData               additional_data = AdditionalData());
 
   /**
    * Initializes the data structures. Same as before, but now the index set
@@ -584,10 +585,10 @@ public:
    */
   template <typename DoFHandlerType, typename QuadratureType>
   void
-  reinit(const Mapping<dim> &                         mapping,
-         const std::vector<const DoFHandlerType *> &  dof_handler,
-         const std::vector<const ConstraintMatrix *> &constraint,
-         const QuadratureType &                       quad,
+  reinit(const Mapping<dim> &                                  mapping,
+         const std::vector<const DoFHandlerType *> &           dof_handler,
+         const std::vector<const AffineConstraints<double> *> &constraint,
+         const QuadratureType &                                quad,
          const AdditionalData additional_data = AdditionalData());
 
   /**
@@ -596,9 +597,9 @@ public:
    */
   template <typename DoFHandlerType, typename QuadratureType>
   void
-  reinit(const std::vector<const DoFHandlerType *> &  dof_handler,
-         const std::vector<const ConstraintMatrix *> &constraint,
-         const QuadratureType &                       quad,
+  reinit(const std::vector<const DoFHandlerType *> &           dof_handler,
+         const std::vector<const AffineConstraints<double> *> &constraint,
+         const QuadratureType &                                quad,
          const AdditionalData additional_data = AdditionalData());
 
   /**
@@ -1154,7 +1155,7 @@ public:
    * this function does not re-arrange the information stored in this class,
    * but rather creates a renumbering for consumption of
    * DoFHandler::renumber_dofs. To have any effect a MatrixFree object must be
-   * set up again using the renumbered DoFHandler and ConstraintMatrix. Note
+   * set up again using the renumbered DoFHandler and AffineConstraints. Note
    * that if a DoFHandler calls DoFHandler::renumber_dofs, all information in
    * MatrixFree becomes invalid.
    */
@@ -1578,23 +1579,25 @@ private:
    * DoFHandler case.
    */
   void
-  internal_reinit(const Mapping<dim> &                         mapping,
-                  const std::vector<const DoFHandler<dim> *> & dof_handler,
-                  const std::vector<const ConstraintMatrix *> &constraint,
-                  const std::vector<IndexSet> &          locally_owned_set,
-                  const std::vector<hp::QCollection<1>> &quad,
-                  const AdditionalData &                 additional_data);
+  internal_reinit(
+    const Mapping<dim> &                                  mapping,
+    const std::vector<const DoFHandler<dim> *> &          dof_handler,
+    const std::vector<const AffineConstraints<double> *> &constraint,
+    const std::vector<IndexSet> &                         locally_owned_set,
+    const std::vector<hp::QCollection<1>> &               quad,
+    const AdditionalData &                                additional_data);
 
   /**
    * Same as before but for hp::DoFHandler instead of generic DoFHandler type.
    */
   void
-  internal_reinit(const Mapping<dim> &                            mapping,
-                  const std::vector<const hp::DoFHandler<dim> *> &dof_handler,
-                  const std::vector<const ConstraintMatrix *> &   constraint,
-                  const std::vector<IndexSet> &          locally_owned_set,
-                  const std::vector<hp::QCollection<1>> &quad,
-                  const AdditionalData &                 additional_data);
+  internal_reinit(
+    const Mapping<dim> &                                  mapping,
+    const std::vector<const hp::DoFHandler<dim> *> &      dof_handler,
+    const std::vector<const AffineConstraints<double> *> &constraint,
+    const std::vector<IndexSet> &                         locally_owned_set,
+    const std::vector<hp::QCollection<1>> &               quad,
+    const AdditionalData &                                additional_data);
 
   /**
    * Initializes the fields in DoFInfo together with the constraint pool that
@@ -1603,9 +1606,10 @@ private:
    * consequently only need to be stored once).
    */
   void
-  initialize_indices(const std::vector<const ConstraintMatrix *> &constraint,
-                     const std::vector<IndexSet> &locally_owned_set,
-                     const AdditionalData &       additional_data);
+  initialize_indices(
+    const std::vector<const AffineConstraints<double> *> &constraint,
+    const std::vector<IndexSet> &                         locally_owned_set,
+    const AdditionalData &                                additional_data);
 
   /**
    * Initializes the DoFHandlers based on a DoFHandler<dim> argument.
@@ -2425,13 +2429,13 @@ template <typename DoFHandlerType, typename QuadratureType>
 void
 MatrixFree<dim, Number>::reinit(
   const DoFHandlerType &                                 dof_handler,
-  const ConstraintMatrix &                               constraints_in,
+  const AffineConstraints<double> &                      constraints_in,
   const QuadratureType &                                 quad,
   const typename MatrixFree<dim, Number>::AdditionalData additional_data)
 {
-  std::vector<const DoFHandlerType *>   dof_handlers;
-  std::vector<const ConstraintMatrix *> constraints;
-  std::vector<QuadratureType>           quads;
+  std::vector<const DoFHandlerType *>            dof_handlers;
+  std::vector<const AffineConstraints<double> *> constraints;
+  std::vector<QuadratureType>                    quads;
 
   dof_handlers.push_back(&dof_handler);
   constraints.push_back(&constraints_in);
@@ -2460,12 +2464,12 @@ void
 MatrixFree<dim, Number>::reinit(
   const Mapping<dim> &                                   mapping,
   const DoFHandlerType &                                 dof_handler,
-  const ConstraintMatrix &                               constraints_in,
+  const AffineConstraints<double> &                      constraints_in,
   const QuadratureType &                                 quad,
   const typename MatrixFree<dim, Number>::AdditionalData additional_data)
 {
-  std::vector<const DoFHandlerType *>   dof_handlers;
-  std::vector<const ConstraintMatrix *> constraints;
+  std::vector<const DoFHandlerType *>            dof_handlers;
+  std::vector<const AffineConstraints<double> *> constraints;
 
   dof_handlers.push_back(&dof_handler);
   constraints.push_back(&constraints_in);
@@ -2492,7 +2496,7 @@ template <typename DoFHandlerType, typename QuadratureType>
 void
 MatrixFree<dim, Number>::reinit(
   const std::vector<const DoFHandlerType *> &            dof_handler,
-  const std::vector<const ConstraintMatrix *> &          constraint,
+  const std::vector<const AffineConstraints<double> *> & constraint,
   const std::vector<QuadratureType> &                    quad,
   const typename MatrixFree<dim, Number>::AdditionalData additional_data)
 {
@@ -2517,7 +2521,7 @@ template <typename DoFHandlerType, typename QuadratureType>
 void
 MatrixFree<dim, Number>::reinit(
   const std::vector<const DoFHandlerType *> &            dof_handler,
-  const std::vector<const ConstraintMatrix *> &          constraint,
+  const std::vector<const AffineConstraints<double> *> & constraint,
   const QuadratureType &                                 quad,
   const typename MatrixFree<dim, Number>::AdditionalData additional_data)
 {
@@ -2542,7 +2546,7 @@ void
 MatrixFree<dim, Number>::reinit(
   const Mapping<dim> &                                   mapping,
   const std::vector<const DoFHandlerType *> &            dof_handler,
-  const std::vector<const ConstraintMatrix *> &          constraint,
+  const std::vector<const AffineConstraints<double> *> & constraint,
   const QuadratureType &                                 quad,
   const typename MatrixFree<dim, Number>::AdditionalData additional_data)
 {
@@ -2567,7 +2571,7 @@ void
 MatrixFree<dim, Number>::reinit(
   const Mapping<dim> &                                   mapping,
   const std::vector<const DoFHandlerType *> &            dof_handler,
-  const std::vector<const ConstraintMatrix *> &          constraint,
+  const std::vector<const AffineConstraints<double> *> & constraint,
   const std::vector<QuadratureType> &                    quad,
   const typename MatrixFree<dim, Number>::AdditionalData additional_data)
 {
@@ -2593,7 +2597,7 @@ void
 MatrixFree<dim, Number>::reinit(
   const Mapping<dim> &                                   mapping,
   const std::vector<const DoFHandlerType *> &            dof_handler,
-  const std::vector<const ConstraintMatrix *> &          constraint,
+  const std::vector<const AffineConstraints<double> *> & constraint,
   const std::vector<IndexSet> &                          locally_owned_set,
   const std::vector<QuadratureType> &                    quad,
   const typename MatrixFree<dim, Number>::AdditionalData additional_data)
index 823f5b8e8d3465283e31dd9de6cae8c1ccfde40b..8c4074dfabdbb308d7047638ef8bc92f53c0019b 100644 (file)
@@ -229,7 +229,7 @@ void
 MatrixFree<dim, Number>::internal_reinit(
   const Mapping<dim> &                                    mapping,
   const std::vector<const DoFHandler<dim> *> &            dof_handler,
-  const std::vector<const ConstraintMatrix *> &           constraint,
+  const std::vector<const AffineConstraints<double> *> &  constraint,
   const std::vector<IndexSet> &                           locally_owned_set,
   const std::vector<hp::QCollection<1>> &                 quad,
   const typename MatrixFree<dim, Number>::AdditionalData &additional_data)
@@ -388,7 +388,7 @@ void
 MatrixFree<dim, Number>::internal_reinit(
   const Mapping<dim> &                                    mapping,
   const std::vector<const hp::DoFHandler<dim> *> &        dof_handler,
-  const std::vector<const ConstraintMatrix *> &           constraint,
+  const std::vector<const AffineConstraints<double> *> &  constraint,
   const std::vector<IndexSet> &                           locally_owned_set,
   const std::vector<hp::QCollection<1>> &                 quad,
   const typename MatrixFree<dim, Number>::AdditionalData &additional_data)
@@ -739,9 +739,9 @@ MatrixFree<dim, Number>::initialize_dof_handlers(
 template <int dim, typename Number>
 void
 MatrixFree<dim, Number>::initialize_indices(
-  const std::vector<const ConstraintMatrix *> &constraint,
-  const std::vector<IndexSet> &                locally_owned_set,
-  const AdditionalData &                       additional_data)
+  const std::vector<const AffineConstraints<double> *> &constraint,
+  const std::vector<IndexSet> &                         locally_owned_set,
+  const AdditionalData &                                additional_data)
 {
   // insert possible ghost cells and construct face topology
   const bool do_face_integrals =

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.