]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Modifications in ReadVector 17788/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 18 Oct 2024 14:50:42 +0000 (16:50 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Fri, 18 Oct 2024 15:48:43 +0000 (17:48 +0200)
21 files changed:
include/deal.II/lac/block_vector_base.h
include/deal.II/lac/la_parallel_vector.h
include/deal.II/lac/la_parallel_vector.templates.h
include/deal.II/lac/petsc_vector_base.h
include/deal.II/lac/read_vector.h
include/deal.II/lac/read_write_vector.h
include/deal.II/lac/trilinos_epetra_vector.h
include/deal.II/lac/trilinos_tpetra_vector.h
include/deal.II/lac/trilinos_tpetra_vector.templates.h
include/deal.II/lac/trilinos_vector.h
include/deal.II/lac/vector.h
include/deal.II/lac/vector.templates.h
include/deal.II/non_matching/fe_values.h
include/deal.II/non_matching/quadrature_generator.h
source/lac/petsc_vector_base.cc
source/lac/trilinos_epetra_vector.cc
source/lac/trilinos_vector.cc
source/non_matching/fe_values.cc
source/non_matching/fe_values.inst.in
source/non_matching/quadrature_generator.cc
source/non_matching/quadrature_generator.inst.in

index 69d69db3f71d6d249f2dda7938e92969d1c2b1d6..c5a0c0211b32f6e19bb477947a22ff0c64ac49de 100644 (file)
@@ -438,8 +438,7 @@ namespace internal
  * @ref GlossBlockLA "Block (linear algebra)"
  */
 template <typename VectorType>
-class BlockVectorBase : public EnableObserverPointer,
-                        public ReadVector<typename VectorType::value_type>
+class BlockVectorBase : public ReadVector<typename VectorType::value_type>
 {
 public:
   /**
@@ -654,7 +653,7 @@ public:
 
   virtual void
   extract_subvector_to(const ArrayView<const types::global_dof_index> &indices,
-                       ArrayView<value_type> &entries) const override;
+                       const ArrayView<value_type> &entries) const override;
 
   /**
    * Instead of getting individual elements of a vector via operator(),
@@ -2175,7 +2174,7 @@ template <typename VectorType>
 inline void
 BlockVectorBase<VectorType>::extract_subvector_to(
   const ArrayView<const types::global_dof_index> &indices,
-  ArrayView<value_type>                          &entries) const
+  const ArrayView<value_type>                    &entries) const
 {
   AssertDimension(indices.size(), entries.size());
   for (unsigned int i = 0; i < indices.size(); ++i)
index 3d69c99348bd953f8d4d9e6407afdff7379a7ae8..6f8a574282102a4844941b3b24316fca88f4a5a5 100644 (file)
@@ -246,8 +246,7 @@ namespace LinearAlgebra
      * @endcode
      */
     template <typename Number, typename MemorySpace = MemorySpace::Host>
-    class Vector : public ::dealii::ReadVector<Number>,
-                   public EnableObserverPointer
+    class Vector : public ::dealii::ReadVector<Number>
     {
     public:
       using memory_space    = MemorySpace;
@@ -1135,7 +1134,7 @@ namespace LinearAlgebra
       virtual void
       extract_subvector_to(
         const ArrayView<const types::global_dof_index> &indices,
-        ArrayView<Number> &elements) const override;
+        const ArrayView<Number> &elements) const override;
 
       /**
        * Instead of getting individual elements of a vector via operator(),
index 1d01fb518ccdd47620b0e75e3e295e7da3d8a958..e35a2fe435ff9dbf988052327f7cc3f96852eee9 100644 (file)
@@ -730,8 +730,7 @@ namespace LinearAlgebra
     template <typename Number, typename MemorySpaceType>
     Vector<Number, MemorySpaceType>::Vector(
       const Vector<Number, MemorySpaceType> &v)
-      : EnableObserverPointer()
-      , allocated_size(0)
+      : allocated_size(0)
       , vector_is_ghosted(false)
       , comm_sm(MPI_COMM_SELF)
     {
@@ -1736,7 +1735,7 @@ namespace LinearAlgebra
     void
     Vector<Number, MemorySpaceType>::extract_subvector_to(
       const ArrayView<const types::global_dof_index> &indices,
-      ArrayView<Number>                              &elements) const
+      const ArrayView<Number>                        &elements) const
     {
       AssertDimension(indices.size(), elements.size());
       for (unsigned int i = 0; i < indices.size(); ++i)
index fb980744b8079acda29064f6e9328da20ea64577..0b922264536525d7fb7d5e05f8c980aadf1e5195 100644 (file)
@@ -249,8 +249,7 @@ namespace PETScWrappers
    *
    * @ingroup PETScWrappers
    */
-  class VectorBase : public ReadVector<PetscScalar>,
-                     public EnableObserverPointer
+  class VectorBase : public ReadVector<PetscScalar>
   {
   public:
     /**
@@ -489,7 +488,7 @@ namespace PETScWrappers
     virtual void
     extract_subvector_to(
       const ArrayView<const types::global_dof_index> &indices,
-      ArrayView<PetscScalar>                         &elements) const override;
+      const ArrayView<PetscScalar>                   &elements) const override;
 
     /**
      * Instead of getting individual elements of a vector via operator(),
@@ -1193,7 +1192,7 @@ namespace PETScWrappers
   inline void
   VectorBase::extract_subvector_to(
     const ArrayView<const types::global_dof_index> &indices,
-    ArrayView<PetscScalar>                         &elements) const
+    const ArrayView<PetscScalar>                   &elements) const
   {
     AssertDimension(indices.size(), elements.size());
     extract_subvector_to(indices.begin(), indices.end(), elements.begin());
index 6f75319a380d856994d85eade33acc0e9945eaee..d9c84238f7708d28696e1dc64bb8e0276f851446 100644 (file)
@@ -37,10 +37,14 @@ DEAL_II_NAMESPACE_OPEN
  * accessing vector elements.
  */
 template <typename Number>
-class ReadVector
+class ReadVector : public EnableObserverPointer
 {
 public:
-  using size_type = types::global_dof_index;
+  /**
+   * Declare some of the standard types used in all containers.
+   */
+  using value_type = Number;
+  using size_type  = types::global_dof_index;
 
   /**
    * Return the size of the vector.
@@ -54,7 +58,7 @@ public:
    */
   virtual void
   extract_subvector_to(const ArrayView<const types::global_dof_index> &indices,
-                       ArrayView<Number> &elements) const = 0;
+                       const ArrayView<Number> &elements) const = 0;
 };
 
 /** @} */
index dd6865e69d7287438315b3a6c5d59f292bafa1dd..e776f9c680eee042c716f481bfc84bc17a7fbe63 100644 (file)
@@ -123,8 +123,7 @@ namespace LinearAlgebra
    * get the first index of the largest range.
    */
   template <typename Number>
-  class ReadWriteVector : public EnableObserverPointer,
-                          public ReadVector<Number>
+  class ReadWriteVector : public ReadVector<Number>
   {
   public:
     /**
@@ -583,7 +582,7 @@ namespace LinearAlgebra
     virtual void
     extract_subvector_to(
       const ArrayView<const types::global_dof_index> &indices,
-      ArrayView<Number>                              &entries) const override;
+      const ArrayView<Number>                        &entries) const override;
 
     /**
      * Instead of getting individual elements of a vector via operator(),
@@ -847,7 +846,6 @@ namespace LinearAlgebra
   template <typename Number>
   inline ReadWriteVector<Number>::ReadWriteVector(
     const ReadWriteVector<Number> &v)
-    : EnableObserverPointer()
   {
     this->operator=(v);
   }
@@ -993,7 +991,7 @@ namespace LinearAlgebra
   void
   ReadWriteVector<Number>::extract_subvector_to(
     const ArrayView<const types::global_dof_index> &indices,
-    ArrayView<Number>                              &entries) const
+    const ArrayView<Number>                        &entries) const
   {
     AssertDimension(indices.size(), entries.size());
     for (unsigned int i = 0; i < indices.size(); ++i)
index abb01652876f1822ba1db66c593c78d66bbe682f..369a31b3dc526b727ba303902ac6e760b9fd01ef 100644 (file)
@@ -222,8 +222,7 @@ namespace LinearAlgebra
      * @ingroup TrilinosWrappers
      * @ingroup Vectors
      */
-    class Vector : public ReadVector<VectorTraits::value_type>,
-                   public EnableObserverPointer
+    class Vector : public ReadVector<VectorTraits::value_type>
     {
     public:
       using value_type      = VectorTraits::value_type;
@@ -281,7 +280,7 @@ namespace LinearAlgebra
       virtual void
       extract_subvector_to(
         const ArrayView<const types::global_dof_index> &indices,
-        ArrayView<double> &elements) const override;
+        const ArrayView<double> &elements) const override;
 
       /**
        * Copy function. This function takes a Vector and copies all the
index 9161ee191f394ed21e31884dfed1ff26c50fef83..db258cec349e5bcc53308e8f3145b6c606ea2bbc 100644 (file)
@@ -285,7 +285,7 @@ namespace LinearAlgebra
      * @ingroup Vectors
      */
     template <typename Number, typename MemorySpace = dealii::MemorySpace::Host>
-    class Vector : public ReadVector<Number>, public EnableObserverPointer
+    class Vector : public ReadVector<Number>
     {
     public:
       /**
@@ -420,7 +420,7 @@ namespace LinearAlgebra
       virtual void
       extract_subvector_to(
         const ArrayView<const types::global_dof_index> &indices,
-        ArrayView<Number> &elements) const override;
+        const ArrayView<Number> &elements) const override;
 
       /**
        * Copy function. This function takes a Vector and copies all the
index 908d31e0c906bf2435c9013cde4a61b04e582624..4814631ea134cbcb2893aa2143cd71d3c4837848 100644 (file)
@@ -78,8 +78,7 @@ namespace LinearAlgebra
 
     template <typename Number, typename MemorySpace>
     Vector<Number, MemorySpace>::Vector()
-      : EnableObserverPointer()
-      , compressed(true)
+      : compressed(true)
       , has_ghost(false)
       , vector(Utilities::Trilinos::internal::make_rcp<
                TpetraTypes::VectorType<Number, MemorySpace>>(
@@ -91,8 +90,7 @@ namespace LinearAlgebra
 
     template <typename Number, typename MemorySpace>
     Vector<Number, MemorySpace>::Vector(const Vector<Number, MemorySpace> &V)
-      : EnableObserverPointer()
-      , compressed(V.compressed)
+      : compressed(V.compressed)
       , has_ghost(V.has_ghost)
       , vector(Utilities::Trilinos::internal::make_rcp<
                TpetraTypes::VectorType<Number, MemorySpace>>(*V.vector,
@@ -109,8 +107,7 @@ namespace LinearAlgebra
     template <typename Number, typename MemorySpace>
     Vector<Number, MemorySpace>::Vector(
       const Teuchos::RCP<TpetraTypes::VectorType<Number, MemorySpace>> V)
-      : EnableObserverPointer()
-      , compressed(true)
+      : compressed(true)
       , has_ghost(V->getMap()->isOneToOne() == false)
       , vector(V)
     {}
@@ -120,8 +117,7 @@ namespace LinearAlgebra
     template <typename Number, typename MemorySpace>
     Vector<Number, MemorySpace>::Vector(const IndexSet &parallel_partitioner,
                                         const MPI_Comm  communicator)
-      : EnableObserverPointer()
-      , compressed(true)
+      : compressed(true)
       , has_ghost(false)
       , vector(Utilities::Trilinos::internal::make_rcp<
                TpetraTypes::VectorType<Number, MemorySpace>>(
@@ -136,7 +132,6 @@ namespace LinearAlgebra
                                         const IndexSet &ghost_entries,
                                         const MPI_Comm  communicator,
                                         const bool      vector_writable)
-      : EnableObserverPointer()
     {
       if (!vector_writable)
         {
@@ -294,7 +289,7 @@ namespace LinearAlgebra
     void
     Vector<Number, MemorySpace>::extract_subvector_to(
       const ArrayView<const types::global_dof_index> &indices,
-      ArrayView<Number>                              &elements) const
+      const ArrayView<Number>                        &elements) const
     {
       AssertDimension(indices.size(), elements.size());
 
index 708ef61e4c793299cd9115bd43e075cbcf67733f..38bf29eaad4ead36e95f516a48fecff4a024478f 100644 (file)
@@ -401,8 +401,7 @@ namespace TrilinosWrappers
      * @ingroup TrilinosWrappers
      * @ingroup Vectors
      */
-    class Vector : public EnableObserverPointer,
-                   public ReadVector<TrilinosScalar>
+    class Vector : public ReadVector<TrilinosScalar>
     {
     public:
       /**
@@ -1032,8 +1031,9 @@ namespace TrilinosWrappers
        * Extract a range of elements all at once.
        */
       virtual void
-      extract_subvector_to(const ArrayView<const size_type> &indices,
-                           ArrayView<TrilinosScalar> &elements) const override;
+      extract_subvector_to(
+        const ArrayView<const size_type> &indices,
+        const ArrayView<TrilinosScalar>  &elements) const override;
 
       /**
        * Instead of getting individual elements of a vector via operator(),
@@ -1582,8 +1582,9 @@ namespace TrilinosWrappers
 
 
     inline void
-    Vector::extract_subvector_to(const ArrayView<const size_type> &indices,
-                                 ArrayView<TrilinosScalar> &elements) const
+    Vector::extract_subvector_to(
+      const ArrayView<const size_type> &indices,
+      const ArrayView<TrilinosScalar>  &elements) const
     {
       AssertDimension(indices.size(), elements.size());
       for (unsigned int i = 0; i < indices.size(); ++i)
index 48aa1cd8bae6472dfc735f6cde7ad9b64b6d81d4..fbaa63ce4c420f87255f45c67edc6c89a84fcf46 100644 (file)
@@ -116,7 +116,7 @@ namespace parallel
  * in the manual).
  */
 template <typename Number>
-class Vector : public EnableObserverPointer, public ReadVector<Number>
+class Vector : public ReadVector<Number>
 {
 public:
   /**
@@ -726,7 +726,7 @@ public:
    */
   virtual void
   extract_subvector_to(const ArrayView<const types::global_dof_index> &indices,
-                       ArrayView<Number> &elements) const override;
+                       const ArrayView<Number> &elements) const override;
 
   /**
    * Instead of getting individual elements of a vector via operator(),
index f48e063a03ff9a947f060cf7ea6ad43662707663..2391f04da298c618cbcfafa041344c5563930a63 100644 (file)
@@ -52,7 +52,6 @@ DEAL_II_NAMESPACE_OPEN
 
 template <typename Number>
 Vector<Number>::Vector(const Vector<Number> &v)
-  : EnableObserverPointer()
 {
   *this = v;
 }
@@ -622,7 +621,7 @@ template <typename Number>
 void
 Vector<Number>::extract_subvector_to(
   const ArrayView<const types::global_dof_index> &indices,
-  ArrayView<Number>                              &elements) const
+  const ArrayView<Number>                        &elements) const
 {
   AssertDimension(indices.size(), elements.size());
   for (unsigned int i = 0; i < indices.size(); ++i)
index 40ed8ec40116f51c4fbae711c4898d653a12ed49..8d2e92d1c51a2ba6f9f4acd73b92b916942724ed 100644 (file)
@@ -166,13 +166,13 @@ namespace NonMatching
      * and @p level_set are stored internally, so these need to have a longer life
      * span than the instance of this class.
      */
-    template <typename VectorType>
+    template <typename Number>
     FEValues(const hp::FECollection<dim> &fe_collection,
              const Quadrature<1>         &quadrature,
              const RegionUpdateFlags      region_update_flags,
              const MeshClassifier<dim>   &mesh_classifier,
              const DoFHandler<dim>       &dof_handler,
-             const VectorType            &level_set,
+             const ReadVector<Number>    &level_set,
              const AdditionalData        &additional_data = AdditionalData());
 
     /**
@@ -201,7 +201,7 @@ namespace NonMatching
      * internally, so these need to have a longer life span than the instance of
      * this class.
      */
-    template <typename VectorType>
+    template <typename Number>
     FEValues(const hp::MappingCollection<dim> &mapping_collection,
              const hp::FECollection<dim>      &fe_collection,
              const hp::QCollection<dim>       &q_collection,
@@ -209,7 +209,7 @@ namespace NonMatching
              const RegionUpdateFlags           region_update_flags,
              const MeshClassifier<dim>        &mesh_classifier,
              const DoFHandler<dim>            &dof_handler,
-             const VectorType                 &level_set,
+             const ReadVector<Number>         &level_set,
              const AdditionalData &additional_data = AdditionalData());
 
     /**
@@ -512,13 +512,13 @@ namespace NonMatching
      * and @p level_set are stored internally, so these need to have a longer life
      * span than the instance of this class.
      */
-    template <typename VectorType>
+    template <typename Number>
     FEInterfaceValues(const hp::FECollection<dim> &fe_collection,
                       const Quadrature<1>         &quadrature,
                       const RegionUpdateFlags      region_update_flags,
                       const MeshClassifier<dim>   &mesh_classifier,
                       const DoFHandler<dim>       &dof_handler,
-                      const VectorType            &level_set,
+                      const ReadVector<Number>    &level_set,
                       const AdditionalData &additional_data = AdditionalData());
 
     /**
@@ -547,7 +547,7 @@ namespace NonMatching
      * internally, so these need to have a longer life span than the instance of
      * this class.
      */
-    template <typename VectorType>
+    template <typename Number>
     FEInterfaceValues(const hp::MappingCollection<dim> &mapping_collection,
                       const hp::FECollection<dim>      &fe_collection,
                       const hp::QCollection<dim - 1>   &q_collection,
@@ -555,7 +555,7 @@ namespace NonMatching
                       const RegionUpdateFlags           region_update_flags,
                       const MeshClassifier<dim>        &mesh_classifier,
                       const DoFHandler<dim>            &dof_handler,
-                      const VectorType                 &level_set,
+                      const ReadVector<Number>         &level_set,
                       const AdditionalData &additional_data = AdditionalData());
 
     /**
index 58ad9d7efac30cae0d84946c400ed215c08ae473..00d96c62f6d2e985cad2489047bc27db856cc2ad 100644 (file)
@@ -543,11 +543,11 @@ namespace NonMatching
      * class. The hp::QCollection<1> and AdditionalData is passed to the
      * QuadratureGenerator class.
      */
-    template <typename VectorType>
+    template <typename Number>
     DiscreteQuadratureGenerator(
       const hp::QCollection<1> &quadratures1D,
       const DoFHandler<dim>    &dof_handler,
-      const VectorType         &level_set,
+      const ReadVector<Number> &level_set,
       const AdditionalData     &additional_data = AdditionalData());
 
     /**
@@ -605,11 +605,11 @@ namespace NonMatching
      * class. The hp::QCollection<1> and AdditionalData is passed to the
      * QuadratureGenerator class.
      */
-    template <typename VectorType>
+    template <typename Number>
     DiscreteFaceQuadratureGenerator(
       const hp::QCollection<1> &quadratures1D,
       const DoFHandler<dim>    &dof_handler,
-      const VectorType         &level_set,
+      const ReadVector<Number> &level_set,
       const AdditionalData     &additional_data = AdditionalData());
 
     /**
index 9a8534cb31fdf17abf914aca4c88d6c431b8f3b8..e1bd8679532f1fa1509e7ec9917688d07279083c 100644 (file)
@@ -128,8 +128,7 @@ namespace PETScWrappers
 
 
   VectorBase::VectorBase(const VectorBase &v)
-    : EnableObserverPointer()
-    , ghosted(v.ghosted)
+    : ghosted(v.ghosted)
     , ghost_indices(v.ghost_indices)
     , last_action(VectorOperation::unknown)
   {
@@ -143,8 +142,7 @@ namespace PETScWrappers
 
 
   VectorBase::VectorBase(const Vec &v)
-    : EnableObserverPointer()
-    , vector(v)
+    : vector(v)
     , ghosted(false)
     , last_action(VectorOperation::unknown)
   {
index d468afbd1ea1442aaf13568e4fc833a3d6cbd9ef..b514f60b10d5b9143d0769e728dc73b317121157 100644 (file)
@@ -81,24 +81,21 @@ namespace LinearAlgebra
 #  endif
 
     Vector::Vector()
-      : EnableObserverPointer()
-      , vector(new Epetra_FEVector(
+      : vector(new Epetra_FEVector(
           Epetra_Map(0, 0, 0, Utilities::Trilinos::comm_self())))
     {}
 
 
 
     Vector::Vector(const Vector &V)
-      : EnableObserverPointer()
-      , vector(new Epetra_FEVector(V.trilinos_vector()))
+      : vector(new Epetra_FEVector(V.trilinos_vector()))
     {}
 
 
 
     Vector::Vector(const IndexSet &parallel_partitioner,
                    const MPI_Comm  communicator)
-      : EnableObserverPointer()
-      , vector(new Epetra_FEVector(
+      : vector(new Epetra_FEVector(
           parallel_partitioner.make_trilinos_map(communicator, false)))
     {}
 
@@ -136,7 +133,7 @@ namespace LinearAlgebra
     void
     Vector::extract_subvector_to(
       const ArrayView<const types::global_dof_index> &indices,
-      ArrayView<double>                              &elements) const
+      const ArrayView<double>                        &elements) const
     {
       AssertDimension(indices.size(), elements.size());
       const auto &vector = trilinos_vector();
index 2c8fad8ca140acefd1e3242846a255741ea9f410..1edc195bcfad0dabaf97c95087e693ca1639bff2 100644 (file)
@@ -77,8 +77,7 @@ namespace TrilinosWrappers
   namespace MPI
   {
     Vector::Vector()
-      : EnableObserverPointer()
-      , last_action(Zero)
+      : last_action(Zero)
       , compressed(true)
       , has_ghosts(false)
       , vector(new Epetra_FEVector(
index 7e190e334a2a6a942961924a5b8edbb3842b4af3..98057365838cb5505511f0c8bd518f65dc8102f0 100644 (file)
@@ -41,13 +41,13 @@ namespace NonMatching
 
 
   template <int dim>
-  template <typename VectorType>
+  template <typename Number>
   FEValues<dim>::FEValues(const hp::FECollection<dim> &fe_collection,
                           const Quadrature<1>         &quadrature,
                           const RegionUpdateFlags      region_update_flags,
                           const MeshClassifier<dim>   &mesh_classifier,
                           const DoFHandler<dim>       &dof_handler,
-                          const VectorType            &level_set,
+                          const ReadVector<Number>    &level_set,
                           const AdditionalData        &additional_data)
     : mapping_collection(&dealii::hp::StaticMappingQ1<dim>::mapping_collection)
     , fe_collection(&fe_collection)
@@ -71,7 +71,7 @@ namespace NonMatching
 
 
   template <int dim>
-  template <typename VectorType>
+  template <typename Number>
   FEValues<dim>::FEValues(const hp::MappingCollection<dim> &mapping_collection,
                           const hp::FECollection<dim>      &fe_collection,
                           const hp::QCollection<dim>       &q_collection,
@@ -79,7 +79,7 @@ namespace NonMatching
                           const RegionUpdateFlags           region_update_flags,
                           const MeshClassifier<dim>        &mesh_classifier,
                           const DoFHandler<dim>            &dof_handler,
-                          const VectorType                 &level_set,
+                          const ReadVector<Number>         &level_set,
                           const AdditionalData             &additional_data)
     : mapping_collection(&mapping_collection)
     , fe_collection(&fe_collection)
@@ -335,14 +335,14 @@ namespace NonMatching
 
 
   template <int dim>
-  template <typename VectorType>
+  template <typename Number>
   FEInterfaceValues<dim>::FEInterfaceValues(
     const hp::FECollection<dim> &fe_collection,
     const Quadrature<1>         &quadrature,
     const RegionUpdateFlags      region_update_flags,
     const MeshClassifier<dim>   &mesh_classifier,
     const DoFHandler<dim>       &dof_handler,
-    const VectorType            &level_set,
+    const ReadVector<Number>    &level_set,
     const AdditionalData        &additional_data)
     : mapping_collection(&dealii::hp::StaticMappingQ1<dim>::mapping_collection)
     , fe_collection(&fe_collection)
@@ -366,7 +366,7 @@ namespace NonMatching
 
 
   template <int dim>
-  template <typename VectorType>
+  template <typename Number>
   FEInterfaceValues<dim>::FEInterfaceValues(
     const hp::MappingCollection<dim> &mapping_collection,
     const hp::FECollection<dim>      &fe_collection,
@@ -375,7 +375,7 @@ namespace NonMatching
     const RegionUpdateFlags           region_update_flags,
     const MeshClassifier<dim>        &mesh_classifier,
     const DoFHandler<dim>            &dof_handler,
-    const VectorType                 &level_set,
+    const ReadVector<Number>         &level_set,
     const AdditionalData             &additional_data)
     : mapping_collection(&mapping_collection)
     , fe_collection(&fe_collection)
index 7a1689e951c51dd0e10b54a985384e6c204a0e82..854be42dc6311fdecde41a2a4bd5880ac3af813b 100644 (file)
@@ -20,7 +20,7 @@ for (deal_II_dimension : DIMENSIONS)
     template class FEInterfaceValues<deal_II_dimension>;
   }
 
-for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS)
+for (S : REAL_SCALARS; deal_II_dimension : DIMENSIONS)
   {
     template FEValues<deal_II_dimension>::FEValues(
       const hp::MappingCollection<deal_II_dimension> &,
@@ -30,7 +30,7 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS)
       const RegionUpdateFlags,
       const MeshClassifier<deal_II_dimension> &,
       const DoFHandler<deal_II_dimension> &,
-      const VEC &,
+      const ReadVector<S> &,
       const typename FEValues<deal_II_dimension>::AdditionalData &);
 
 
@@ -40,7 +40,7 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS)
       const RegionUpdateFlags,
       const MeshClassifier<deal_II_dimension> &,
       const DoFHandler<deal_II_dimension> &,
-      const VEC &,
+      const ReadVector<S> &,
       const typename FEValues<deal_II_dimension>::AdditionalData &);
 
     template FEInterfaceValues<deal_II_dimension>::FEInterfaceValues(
@@ -49,7 +49,7 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS)
       const RegionUpdateFlags,
       const MeshClassifier<deal_II_dimension> &,
       const DoFHandler<deal_II_dimension> &,
-      const VEC &,
+      const ReadVector<S> &,
       const FEInterfaceValues<deal_II_dimension>::AdditionalData &);
 
     template FEInterfaceValues<deal_II_dimension>::FEInterfaceValues(
@@ -60,7 +60,7 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS)
       const RegionUpdateFlags,
       const MeshClassifier<deal_II_dimension> &,
       const DoFHandler<deal_II_dimension> &,
-      const VEC &,
+      const ReadVector<S> &,
       const AdditionalData &);
   }
 
index d8bd93cde0f9e3a7f75299581b7857b519cf4211..dead7e2415f085b1558d14498a0b8de746ffadb2 100644 (file)
@@ -1331,7 +1331,7 @@ namespace NonMatching
        * function must be called to specify which cell the function should be
        * evaluated on.
        */
-      template <int dim, typename VectorType = Vector<double>>
+      template <int dim, typename Number>
       class RefSpaceFEFieldFunction : public CellWiseFunction<dim>
       {
       public:
@@ -1342,8 +1342,8 @@ namespace NonMatching
          * have a longer lifetime than the created RefSpaceFEFieldFunction
          * object.
          */
-        RefSpaceFEFieldFunction(const DoFHandler<dim> &dof_handler,
-                                const VectorType      &dof_values);
+        RefSpaceFEFieldFunction(const DoFHandler<dim>    &dof_handler,
+                                const ReadVector<Number> &dof_values);
 
         /**
          * @copydoc CellWiseFunction::set_active_cell()
@@ -1420,7 +1420,7 @@ namespace NonMatching
          * Pointer to the vector of solution coefficients passed to the
          * constructor.
          */
-        const ObserverPointer<const VectorType> global_dof_values;
+        const ObserverPointer<const ReadVector<Number>> global_dof_values;
 
         /**
          * Pointer to the element associated with the cell in the last call to
@@ -1437,13 +1437,13 @@ namespace NonMatching
          * Local solution values of the cell in the last call to
          * set_active_cell().
          */
-        std::vector<typename VectorType::value_type> local_dof_values;
+        std::vector<Number> local_dof_values;
 
         /**
          * Local solution values of the subcell after the last call to
          * set_subcell().
          */
-        std::vector<typename VectorType::value_type> local_dof_values_subcell;
+        std::vector<Number> local_dof_values_subcell;
 
         /**
          * Bounding box of the subcell after the last call to set_subcell().
@@ -1481,10 +1481,10 @@ namespace NonMatching
 
 
 
-      template <int dim, typename VectorType>
-      RefSpaceFEFieldFunction<dim, VectorType>::RefSpaceFEFieldFunction(
-        const DoFHandler<dim> &dof_handler,
-        const VectorType      &dof_values)
+      template <int dim, typename Number>
+      RefSpaceFEFieldFunction<dim, Number>::RefSpaceFEFieldFunction(
+        const DoFHandler<dim>    &dof_handler,
+        const ReadVector<Number> &dof_values)
         : dof_handler(&dof_handler)
         , global_dof_values(&dof_values)
         , n_subdivisions_per_line(numbers::invalid_unsigned_int)
@@ -1495,9 +1495,9 @@ namespace NonMatching
 
 
 
-      template <int dim, typename VectorType>
+      template <int dim, typename Number>
       void
-      RefSpaceFEFieldFunction<dim, VectorType>::set_active_cell(
+      RefSpaceFEFieldFunction<dim, Number>::set_active_cell(
         const typename Triangulation<dim>::active_cell_iterator &cell)
       {
         Assert(
@@ -1565,17 +1565,15 @@ namespace NonMatching
 
         local_dof_values.resize(element->dofs_per_cell);
 
-        for (unsigned int i = 0; i < local_dof_indices.size(); ++i)
-          local_dof_values[i] =
-            dealii::internal::ElementAccess<VectorType>::get(
-              *global_dof_values, local_dof_indices[i]);
+        global_dof_values->extract_subvector_to(local_dof_indices,
+                                                local_dof_values);
       }
 
 
 
-      template <int dim, typename VectorType>
+      template <int dim, typename Number>
       void
-      RefSpaceFEFieldFunction<dim, VectorType>::set_subcell(
+      RefSpaceFEFieldFunction<dim, Number>::set_subcell(
         const std::vector<unsigned int> &mask,
         const BoundingBox<dim>          &subcell_box)
       {
@@ -1587,27 +1585,27 @@ namespace NonMatching
 
 
 
-      template <int dim, typename VectorType>
+      template <int dim, typename Number>
       bool
-      RefSpaceFEFieldFunction<dim, VectorType>::is_fe_q_iso_q1() const
+      RefSpaceFEFieldFunction<dim, Number>::is_fe_q_iso_q1() const
       {
         return n_subdivisions_per_line != numbers::invalid_unsigned_int;
       }
 
 
 
-      template <int dim, typename VectorType>
+      template <int dim, typename Number>
       unsigned int
-      RefSpaceFEFieldFunction<dim, VectorType>::n_subdivisions() const
+      RefSpaceFEFieldFunction<dim, Number>::n_subdivisions() const
       {
         return n_subdivisions_per_line;
       }
 
 
 
-      template <int dim, typename VectorType>
+      template <int dim, typename Number>
       bool
-      RefSpaceFEFieldFunction<dim, VectorType>::cell_is_set() const
+      RefSpaceFEFieldFunction<dim, Number>::cell_is_set() const
       {
         // If set cell hasn't been called the size of local_dof_values will be
         // zero.
@@ -1616,9 +1614,9 @@ namespace NonMatching
 
 
 
-      template <int dim, typename VectorType>
+      template <int dim, typename Number>
       double
-      RefSpaceFEFieldFunction<dim, VectorType>::value(
+      RefSpaceFEFieldFunction<dim, Number>::value(
         const Point<dim>  &point,
         const unsigned int component) const
       {
@@ -1654,9 +1652,9 @@ namespace NonMatching
 
 
 
-      template <int dim, typename VectorType>
+      template <int dim, typename Number>
       Tensor<1, dim>
-      RefSpaceFEFieldFunction<dim, VectorType>::gradient(
+      RefSpaceFEFieldFunction<dim, Number>::gradient(
         const Point<dim>  &point,
         const unsigned int component) const
       {
@@ -1695,9 +1693,9 @@ namespace NonMatching
 
 
 
-      template <int dim, typename VectorType>
+      template <int dim, typename Number>
       SymmetricTensor<2, dim>
-      RefSpaceFEFieldFunction<dim, VectorType>::hessian(
+      RefSpaceFEFieldFunction<dim, Number>::hessian(
         const Point<dim>  &point,
         const unsigned int component) const
       {
@@ -2118,18 +2116,17 @@ namespace NonMatching
 
 
   template <int dim>
-  template <typename VectorType>
+  template <typename Number>
   DiscreteQuadratureGenerator<dim>::DiscreteQuadratureGenerator(
     const hp::QCollection<1> &quadratures1D,
     const DoFHandler<dim>    &dof_handler,
-    const VectorType         &level_set,
+    const ReadVector<Number> &level_set,
     const AdditionalData     &additional_data)
     : QuadratureGenerator<dim>(quadratures1D, additional_data)
     , reference_space_level_set(
         std::make_unique<internal::DiscreteQuadratureGeneratorImplementation::
-                           RefSpaceFEFieldFunction<dim, VectorType>>(
-          dof_handler,
-          level_set))
+                           RefSpaceFEFieldFunction<dim, Number>>(dof_handler,
+                                                                 level_set))
   {}
 
 
@@ -2211,18 +2208,17 @@ namespace NonMatching
 
 
   template <int dim>
-  template <typename VectorType>
+  template <typename Number>
   DiscreteFaceQuadratureGenerator<dim>::DiscreteFaceQuadratureGenerator(
     const hp::QCollection<1> &quadratures1D,
     const DoFHandler<dim>    &dof_handler,
-    const VectorType         &level_set,
+    const ReadVector<Number> &level_set,
     const AdditionalData     &additional_data)
     : FaceQuadratureGenerator<dim>(quadratures1D, additional_data)
     , reference_space_level_set(
         std::make_unique<internal::DiscreteQuadratureGeneratorImplementation::
-                           RefSpaceFEFieldFunction<dim, VectorType>>(
-          dof_handler,
-          level_set))
+                           RefSpaceFEFieldFunction<dim, Number>>(dof_handler,
+                                                                 level_set))
   {}
 
 
index f236e33f836bfd7452b04916f8a64ea939c9ca5c..b9621b7770274cff2606c385d1846347ab424985 100644 (file)
@@ -84,17 +84,17 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
 #endif
   }
 
-for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS)
+for (S : REAL_SCALARS; deal_II_dimension : DIMENSIONS)
   {
     template NonMatching::DiscreteQuadratureGenerator<deal_II_dimension>::
       DiscreteQuadratureGenerator(const hp::QCollection<1> &,
                                   const DoFHandler<deal_II_dimension> &,
-                                  const VEC &,
+                                  const ReadVector<S> &,
                                   const AdditionalData &);
 
     template NonMatching::DiscreteFaceQuadratureGenerator<deal_II_dimension>::
       DiscreteFaceQuadratureGenerator(const hp::QCollection<1> &,
                                       const DoFHandler<deal_II_dimension> &,
-                                      const VEC &,
+                                      const ReadVector<S> &,
                                       const AdditionalData &);
   }

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.