From d6865017d1e529fcbbe17451fed0e49d8e7fcf67 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 18 Oct 2024 16:50:42 +0200 Subject: [PATCH] Modifications in ReadVector --- include/deal.II/lac/block_vector_base.h | 7 +- include/deal.II/lac/la_parallel_vector.h | 5 +- .../lac/la_parallel_vector.templates.h | 5 +- include/deal.II/lac/petsc_vector_base.h | 7 +- include/deal.II/lac/read_vector.h | 10 ++- include/deal.II/lac/read_write_vector.h | 8 +- include/deal.II/lac/trilinos_epetra_vector.h | 5 +- include/deal.II/lac/trilinos_tpetra_vector.h | 4 +- .../lac/trilinos_tpetra_vector.templates.h | 15 ++-- include/deal.II/lac/trilinos_vector.h | 13 ++-- include/deal.II/lac/vector.h | 4 +- include/deal.II/lac/vector.templates.h | 3 +- include/deal.II/non_matching/fe_values.h | 16 ++-- .../non_matching/quadrature_generator.h | 8 +- source/lac/petsc_vector_base.cc | 6 +- source/lac/trilinos_epetra_vector.cc | 11 +-- source/lac/trilinos_vector.cc | 3 +- source/non_matching/fe_values.cc | 16 ++-- source/non_matching/fe_values.inst.in | 10 +-- source/non_matching/quadrature_generator.cc | 76 +++++++++---------- .../non_matching/quadrature_generator.inst.in | 6 +- 21 files changed, 110 insertions(+), 128 deletions(-) diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 69d69db3f7..c5a0c0211b 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -438,8 +438,7 @@ namespace internal * @ref GlossBlockLA "Block (linear algebra)" */ template -class BlockVectorBase : public EnableObserverPointer, - public ReadVector +class BlockVectorBase : public ReadVector { public: /** @@ -654,7 +653,7 @@ public: virtual void extract_subvector_to(const ArrayView &indices, - ArrayView &entries) const override; + const ArrayView &entries) const override; /** * Instead of getting individual elements of a vector via operator(), @@ -2175,7 +2174,7 @@ template inline void BlockVectorBase::extract_subvector_to( const ArrayView &indices, - ArrayView &entries) const + const ArrayView &entries) const { AssertDimension(indices.size(), entries.size()); for (unsigned int i = 0; i < indices.size(); ++i) diff --git a/include/deal.II/lac/la_parallel_vector.h b/include/deal.II/lac/la_parallel_vector.h index 3d69c99348..6f8a574282 100644 --- a/include/deal.II/lac/la_parallel_vector.h +++ b/include/deal.II/lac/la_parallel_vector.h @@ -246,8 +246,7 @@ namespace LinearAlgebra * @endcode */ template - class Vector : public ::dealii::ReadVector, - public EnableObserverPointer + class Vector : public ::dealii::ReadVector { public: using memory_space = MemorySpace; @@ -1135,7 +1134,7 @@ namespace LinearAlgebra virtual void extract_subvector_to( const ArrayView &indices, - ArrayView &elements) const override; + const ArrayView &elements) const override; /** * Instead of getting individual elements of a vector via operator(), diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 1d01fb518c..e35a2fe435 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -730,8 +730,7 @@ namespace LinearAlgebra template Vector::Vector( const Vector &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::extract_subvector_to( const ArrayView &indices, - ArrayView &elements) const + const ArrayView &elements) const { AssertDimension(indices.size(), elements.size()); for (unsigned int i = 0; i < indices.size(); ++i) diff --git a/include/deal.II/lac/petsc_vector_base.h b/include/deal.II/lac/petsc_vector_base.h index fb980744b8..0b92226453 100644 --- a/include/deal.II/lac/petsc_vector_base.h +++ b/include/deal.II/lac/petsc_vector_base.h @@ -249,8 +249,7 @@ namespace PETScWrappers * * @ingroup PETScWrappers */ - class VectorBase : public ReadVector, - public EnableObserverPointer + class VectorBase : public ReadVector { public: /** @@ -489,7 +488,7 @@ namespace PETScWrappers virtual void extract_subvector_to( const ArrayView &indices, - ArrayView &elements) const override; + const ArrayView &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 &indices, - ArrayView &elements) const + const ArrayView &elements) const { AssertDimension(indices.size(), elements.size()); extract_subvector_to(indices.begin(), indices.end(), elements.begin()); diff --git a/include/deal.II/lac/read_vector.h b/include/deal.II/lac/read_vector.h index 6f75319a38..d9c84238f7 100644 --- a/include/deal.II/lac/read_vector.h +++ b/include/deal.II/lac/read_vector.h @@ -37,10 +37,14 @@ DEAL_II_NAMESPACE_OPEN * accessing vector elements. */ template -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 &indices, - ArrayView &elements) const = 0; + const ArrayView &elements) const = 0; }; /** @} */ diff --git a/include/deal.II/lac/read_write_vector.h b/include/deal.II/lac/read_write_vector.h index dd6865e69d..e776f9c680 100644 --- a/include/deal.II/lac/read_write_vector.h +++ b/include/deal.II/lac/read_write_vector.h @@ -123,8 +123,7 @@ namespace LinearAlgebra * get the first index of the largest range. */ template - class ReadWriteVector : public EnableObserverPointer, - public ReadVector + class ReadWriteVector : public ReadVector { public: /** @@ -583,7 +582,7 @@ namespace LinearAlgebra virtual void extract_subvector_to( const ArrayView &indices, - ArrayView &entries) const override; + const ArrayView &entries) const override; /** * Instead of getting individual elements of a vector via operator(), @@ -847,7 +846,6 @@ namespace LinearAlgebra template inline ReadWriteVector::ReadWriteVector( const ReadWriteVector &v) - : EnableObserverPointer() { this->operator=(v); } @@ -993,7 +991,7 @@ namespace LinearAlgebra void ReadWriteVector::extract_subvector_to( const ArrayView &indices, - ArrayView &entries) const + const ArrayView &entries) const { AssertDimension(indices.size(), entries.size()); for (unsigned int i = 0; i < indices.size(); ++i) diff --git a/include/deal.II/lac/trilinos_epetra_vector.h b/include/deal.II/lac/trilinos_epetra_vector.h index abb0165287..369a31b3dc 100644 --- a/include/deal.II/lac/trilinos_epetra_vector.h +++ b/include/deal.II/lac/trilinos_epetra_vector.h @@ -222,8 +222,7 @@ namespace LinearAlgebra * @ingroup TrilinosWrappers * @ingroup Vectors */ - class Vector : public ReadVector, - public EnableObserverPointer + class Vector : public ReadVector { public: using value_type = VectorTraits::value_type; @@ -281,7 +280,7 @@ namespace LinearAlgebra virtual void extract_subvector_to( const ArrayView &indices, - ArrayView &elements) const override; + const ArrayView &elements) const override; /** * Copy function. This function takes a Vector and copies all the diff --git a/include/deal.II/lac/trilinos_tpetra_vector.h b/include/deal.II/lac/trilinos_tpetra_vector.h index 9161ee191f..db258cec34 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.h @@ -285,7 +285,7 @@ namespace LinearAlgebra * @ingroup Vectors */ template - class Vector : public ReadVector, public EnableObserverPointer + class Vector : public ReadVector { public: /** @@ -420,7 +420,7 @@ namespace LinearAlgebra virtual void extract_subvector_to( const ArrayView &indices, - ArrayView &elements) const override; + const ArrayView &elements) const override; /** * Copy function. This function takes a Vector and copies all the diff --git a/include/deal.II/lac/trilinos_tpetra_vector.templates.h b/include/deal.II/lac/trilinos_tpetra_vector.templates.h index 908d31e0c9..4814631ea1 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.templates.h @@ -78,8 +78,7 @@ namespace LinearAlgebra template Vector::Vector() - : EnableObserverPointer() - , compressed(true) + : compressed(true) , has_ghost(false) , vector(Utilities::Trilinos::internal::make_rcp< TpetraTypes::VectorType>( @@ -91,8 +90,7 @@ namespace LinearAlgebra template Vector::Vector(const Vector &V) - : EnableObserverPointer() - , compressed(V.compressed) + : compressed(V.compressed) , has_ghost(V.has_ghost) , vector(Utilities::Trilinos::internal::make_rcp< TpetraTypes::VectorType>(*V.vector, @@ -109,8 +107,7 @@ namespace LinearAlgebra template Vector::Vector( const Teuchos::RCP> V) - : EnableObserverPointer() - , compressed(true) + : compressed(true) , has_ghost(V->getMap()->isOneToOne() == false) , vector(V) {} @@ -120,8 +117,7 @@ namespace LinearAlgebra template Vector::Vector(const IndexSet ¶llel_partitioner, const MPI_Comm communicator) - : EnableObserverPointer() - , compressed(true) + : compressed(true) , has_ghost(false) , vector(Utilities::Trilinos::internal::make_rcp< TpetraTypes::VectorType>( @@ -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::extract_subvector_to( const ArrayView &indices, - ArrayView &elements) const + const ArrayView &elements) const { AssertDimension(indices.size(), elements.size()); diff --git a/include/deal.II/lac/trilinos_vector.h b/include/deal.II/lac/trilinos_vector.h index 708ef61e4c..38bf29eaad 100644 --- a/include/deal.II/lac/trilinos_vector.h +++ b/include/deal.II/lac/trilinos_vector.h @@ -401,8 +401,7 @@ namespace TrilinosWrappers * @ingroup TrilinosWrappers * @ingroup Vectors */ - class Vector : public EnableObserverPointer, - public ReadVector + class Vector : public ReadVector { public: /** @@ -1032,8 +1031,9 @@ namespace TrilinosWrappers * Extract a range of elements all at once. */ virtual void - extract_subvector_to(const ArrayView &indices, - ArrayView &elements) const override; + extract_subvector_to( + const ArrayView &indices, + const ArrayView &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 &indices, - ArrayView &elements) const + Vector::extract_subvector_to( + const ArrayView &indices, + const ArrayView &elements) const { AssertDimension(indices.size(), elements.size()); for (unsigned int i = 0; i < indices.size(); ++i) diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index 48aa1cd8ba..fbaa63ce4c 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -116,7 +116,7 @@ namespace parallel * in the manual). */ template -class Vector : public EnableObserverPointer, public ReadVector +class Vector : public ReadVector { public: /** @@ -726,7 +726,7 @@ public: */ virtual void extract_subvector_to(const ArrayView &indices, - ArrayView &elements) const override; + const ArrayView &elements) const override; /** * Instead of getting individual elements of a vector via operator(), diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index f48e063a03..2391f04da2 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -52,7 +52,6 @@ DEAL_II_NAMESPACE_OPEN template Vector::Vector(const Vector &v) - : EnableObserverPointer() { *this = v; } @@ -622,7 +621,7 @@ template void Vector::extract_subvector_to( const ArrayView &indices, - ArrayView &elements) const + const ArrayView &elements) const { AssertDimension(indices.size(), elements.size()); for (unsigned int i = 0; i < indices.size(); ++i) diff --git a/include/deal.II/non_matching/fe_values.h b/include/deal.II/non_matching/fe_values.h index 40ed8ec401..8d2e92d1c5 100644 --- a/include/deal.II/non_matching/fe_values.h +++ b/include/deal.II/non_matching/fe_values.h @@ -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 + template FEValues(const hp::FECollection &fe_collection, const Quadrature<1> &quadrature, const RegionUpdateFlags region_update_flags, const MeshClassifier &mesh_classifier, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &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 + template FEValues(const hp::MappingCollection &mapping_collection, const hp::FECollection &fe_collection, const hp::QCollection &q_collection, @@ -209,7 +209,7 @@ namespace NonMatching const RegionUpdateFlags region_update_flags, const MeshClassifier &mesh_classifier, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &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 + template FEInterfaceValues(const hp::FECollection &fe_collection, const Quadrature<1> &quadrature, const RegionUpdateFlags region_update_flags, const MeshClassifier &mesh_classifier, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &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 + template FEInterfaceValues(const hp::MappingCollection &mapping_collection, const hp::FECollection &fe_collection, const hp::QCollection &q_collection, @@ -555,7 +555,7 @@ namespace NonMatching const RegionUpdateFlags region_update_flags, const MeshClassifier &mesh_classifier, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &level_set, const AdditionalData &additional_data = AdditionalData()); /** diff --git a/include/deal.II/non_matching/quadrature_generator.h b/include/deal.II/non_matching/quadrature_generator.h index 58ad9d7efa..00d96c62f6 100644 --- a/include/deal.II/non_matching/quadrature_generator.h +++ b/include/deal.II/non_matching/quadrature_generator.h @@ -543,11 +543,11 @@ namespace NonMatching * class. The hp::QCollection<1> and AdditionalData is passed to the * QuadratureGenerator class. */ - template + template DiscreteQuadratureGenerator( const hp::QCollection<1> &quadratures1D, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &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 + template DiscreteFaceQuadratureGenerator( const hp::QCollection<1> &quadratures1D, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &level_set, const AdditionalData &additional_data = AdditionalData()); /** diff --git a/source/lac/petsc_vector_base.cc b/source/lac/petsc_vector_base.cc index 9a8534cb31..e1bd867953 100644 --- a/source/lac/petsc_vector_base.cc +++ b/source/lac/petsc_vector_base.cc @@ -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) { diff --git a/source/lac/trilinos_epetra_vector.cc b/source/lac/trilinos_epetra_vector.cc index d468afbd1e..b514f60b10 100644 --- a/source/lac/trilinos_epetra_vector.cc +++ b/source/lac/trilinos_epetra_vector.cc @@ -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 ¶llel_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 &indices, - ArrayView &elements) const + const ArrayView &elements) const { AssertDimension(indices.size(), elements.size()); const auto &vector = trilinos_vector(); diff --git a/source/lac/trilinos_vector.cc b/source/lac/trilinos_vector.cc index 2c8fad8ca1..1edc195bcf 100644 --- a/source/lac/trilinos_vector.cc +++ b/source/lac/trilinos_vector.cc @@ -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( diff --git a/source/non_matching/fe_values.cc b/source/non_matching/fe_values.cc index 7e190e334a..9805736583 100644 --- a/source/non_matching/fe_values.cc +++ b/source/non_matching/fe_values.cc @@ -41,13 +41,13 @@ namespace NonMatching template - template + template FEValues::FEValues(const hp::FECollection &fe_collection, const Quadrature<1> &quadrature, const RegionUpdateFlags region_update_flags, const MeshClassifier &mesh_classifier, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &level_set, const AdditionalData &additional_data) : mapping_collection(&dealii::hp::StaticMappingQ1::mapping_collection) , fe_collection(&fe_collection) @@ -71,7 +71,7 @@ namespace NonMatching template - template + template FEValues::FEValues(const hp::MappingCollection &mapping_collection, const hp::FECollection &fe_collection, const hp::QCollection &q_collection, @@ -79,7 +79,7 @@ namespace NonMatching const RegionUpdateFlags region_update_flags, const MeshClassifier &mesh_classifier, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &level_set, const AdditionalData &additional_data) : mapping_collection(&mapping_collection) , fe_collection(&fe_collection) @@ -335,14 +335,14 @@ namespace NonMatching template - template + template FEInterfaceValues::FEInterfaceValues( const hp::FECollection &fe_collection, const Quadrature<1> &quadrature, const RegionUpdateFlags region_update_flags, const MeshClassifier &mesh_classifier, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &level_set, const AdditionalData &additional_data) : mapping_collection(&dealii::hp::StaticMappingQ1::mapping_collection) , fe_collection(&fe_collection) @@ -366,7 +366,7 @@ namespace NonMatching template - template + template FEInterfaceValues::FEInterfaceValues( const hp::MappingCollection &mapping_collection, const hp::FECollection &fe_collection, @@ -375,7 +375,7 @@ namespace NonMatching const RegionUpdateFlags region_update_flags, const MeshClassifier &mesh_classifier, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &level_set, const AdditionalData &additional_data) : mapping_collection(&mapping_collection) , fe_collection(&fe_collection) diff --git a/source/non_matching/fe_values.inst.in b/source/non_matching/fe_values.inst.in index 7a1689e951..854be42dc6 100644 --- a/source/non_matching/fe_values.inst.in +++ b/source/non_matching/fe_values.inst.in @@ -20,7 +20,7 @@ for (deal_II_dimension : DIMENSIONS) template class FEInterfaceValues; } -for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS) +for (S : REAL_SCALARS; deal_II_dimension : DIMENSIONS) { template FEValues::FEValues( const hp::MappingCollection &, @@ -30,7 +30,7 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS) const RegionUpdateFlags, const MeshClassifier &, const DoFHandler &, - const VEC &, + const ReadVector &, const typename FEValues::AdditionalData &); @@ -40,7 +40,7 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS) const RegionUpdateFlags, const MeshClassifier &, const DoFHandler &, - const VEC &, + const ReadVector &, const typename FEValues::AdditionalData &); template FEInterfaceValues::FEInterfaceValues( @@ -49,7 +49,7 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS) const RegionUpdateFlags, const MeshClassifier &, const DoFHandler &, - const VEC &, + const ReadVector &, const FEInterfaceValues::AdditionalData &); template FEInterfaceValues::FEInterfaceValues( @@ -60,7 +60,7 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS) const RegionUpdateFlags, const MeshClassifier &, const DoFHandler &, - const VEC &, + const ReadVector &, const AdditionalData &); } diff --git a/source/non_matching/quadrature_generator.cc b/source/non_matching/quadrature_generator.cc index d8bd93cde0..dead7e2415 100644 --- a/source/non_matching/quadrature_generator.cc +++ b/source/non_matching/quadrature_generator.cc @@ -1331,7 +1331,7 @@ namespace NonMatching * function must be called to specify which cell the function should be * evaluated on. */ - template > + template class RefSpaceFEFieldFunction : public CellWiseFunction { public: @@ -1342,8 +1342,8 @@ namespace NonMatching * have a longer lifetime than the created RefSpaceFEFieldFunction * object. */ - RefSpaceFEFieldFunction(const DoFHandler &dof_handler, - const VectorType &dof_values); + RefSpaceFEFieldFunction(const DoFHandler &dof_handler, + const ReadVector &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 global_dof_values; + const ObserverPointer> 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 local_dof_values; + std::vector local_dof_values; /** * Local solution values of the subcell after the last call to * set_subcell(). */ - std::vector local_dof_values_subcell; + std::vector local_dof_values_subcell; /** * Bounding box of the subcell after the last call to set_subcell(). @@ -1481,10 +1481,10 @@ namespace NonMatching - template - RefSpaceFEFieldFunction::RefSpaceFEFieldFunction( - const DoFHandler &dof_handler, - const VectorType &dof_values) + template + RefSpaceFEFieldFunction::RefSpaceFEFieldFunction( + const DoFHandler &dof_handler, + const ReadVector &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 + template void - RefSpaceFEFieldFunction::set_active_cell( + RefSpaceFEFieldFunction::set_active_cell( const typename Triangulation::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::get( - *global_dof_values, local_dof_indices[i]); + global_dof_values->extract_subvector_to(local_dof_indices, + local_dof_values); } - template + template void - RefSpaceFEFieldFunction::set_subcell( + RefSpaceFEFieldFunction::set_subcell( const std::vector &mask, const BoundingBox &subcell_box) { @@ -1587,27 +1585,27 @@ namespace NonMatching - template + template bool - RefSpaceFEFieldFunction::is_fe_q_iso_q1() const + RefSpaceFEFieldFunction::is_fe_q_iso_q1() const { return n_subdivisions_per_line != numbers::invalid_unsigned_int; } - template + template unsigned int - RefSpaceFEFieldFunction::n_subdivisions() const + RefSpaceFEFieldFunction::n_subdivisions() const { return n_subdivisions_per_line; } - template + template bool - RefSpaceFEFieldFunction::cell_is_set() const + RefSpaceFEFieldFunction::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 + template double - RefSpaceFEFieldFunction::value( + RefSpaceFEFieldFunction::value( const Point &point, const unsigned int component) const { @@ -1654,9 +1652,9 @@ namespace NonMatching - template + template Tensor<1, dim> - RefSpaceFEFieldFunction::gradient( + RefSpaceFEFieldFunction::gradient( const Point &point, const unsigned int component) const { @@ -1695,9 +1693,9 @@ namespace NonMatching - template + template SymmetricTensor<2, dim> - RefSpaceFEFieldFunction::hessian( + RefSpaceFEFieldFunction::hessian( const Point &point, const unsigned int component) const { @@ -2118,18 +2116,17 @@ namespace NonMatching template - template + template DiscreteQuadratureGenerator::DiscreteQuadratureGenerator( const hp::QCollection<1> &quadratures1D, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &level_set, const AdditionalData &additional_data) : QuadratureGenerator(quadratures1D, additional_data) , reference_space_level_set( std::make_unique>( - dof_handler, - level_set)) + RefSpaceFEFieldFunction>(dof_handler, + level_set)) {} @@ -2211,18 +2208,17 @@ namespace NonMatching template - template + template DiscreteFaceQuadratureGenerator::DiscreteFaceQuadratureGenerator( const hp::QCollection<1> &quadratures1D, const DoFHandler &dof_handler, - const VectorType &level_set, + const ReadVector &level_set, const AdditionalData &additional_data) : FaceQuadratureGenerator(quadratures1D, additional_data) , reference_space_level_set( std::make_unique>( - dof_handler, - level_set)) + RefSpaceFEFieldFunction>(dof_handler, + level_set)) {} diff --git a/source/non_matching/quadrature_generator.inst.in b/source/non_matching/quadrature_generator.inst.in index f236e33f83..b9621b7770 100644 --- a/source/non_matching/quadrature_generator.inst.in +++ b/source/non_matching/quadrature_generator.inst.in @@ -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:: DiscreteQuadratureGenerator(const hp::QCollection<1> &, const DoFHandler &, - const VEC &, + const ReadVector &, const AdditionalData &); template NonMatching::DiscreteFaceQuadratureGenerator:: DiscreteFaceQuadratureGenerator(const hp::QCollection<1> &, const DoFHandler &, - const VEC &, + const ReadVector &, const AdditionalData &); } -- 2.39.5