* @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:
/**
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(),
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)
* @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;
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(),
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)
{
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)
*
* @ingroup PETScWrappers
*/
- class VectorBase : public ReadVector<PetscScalar>,
- public EnableObserverPointer
+ class VectorBase : public ReadVector<PetscScalar>
{
public:
/**
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(),
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());
* 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.
*/
virtual void
extract_subvector_to(const ArrayView<const types::global_dof_index> &indices,
- ArrayView<Number> &elements) const = 0;
+ const ArrayView<Number> &elements) const = 0;
};
/** @} */
* get the first index of the largest range.
*/
template <typename Number>
- class ReadWriteVector : public EnableObserverPointer,
- public ReadVector<Number>
+ class ReadWriteVector : public ReadVector<Number>
{
public:
/**
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(),
template <typename Number>
inline ReadWriteVector<Number>::ReadWriteVector(
const ReadWriteVector<Number> &v)
- : EnableObserverPointer()
{
this->operator=(v);
}
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)
* @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;
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
* @ingroup Vectors
*/
template <typename Number, typename MemorySpace = dealii::MemorySpace::Host>
- class Vector : public ReadVector<Number>, public EnableObserverPointer
+ class Vector : public ReadVector<Number>
{
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;
/**
* Copy function. This function takes a Vector and copies all the
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>>(
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,
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)
{}
template <typename Number, typename MemorySpace>
Vector<Number, MemorySpace>::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<Number, MemorySpace>>(
const IndexSet &ghost_entries,
const MPI_Comm communicator,
const bool vector_writable)
- : EnableObserverPointer()
{
if (!vector_writable)
{
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());
* @ingroup TrilinosWrappers
* @ingroup Vectors
*/
- class Vector : public EnableObserverPointer,
- public ReadVector<TrilinosScalar>
+ class Vector : public ReadVector<TrilinosScalar>
{
public:
/**
* 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(),
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)
* in the manual).
*/
template <typename Number>
-class Vector : public EnableObserverPointer, public ReadVector<Number>
+class Vector : public ReadVector<Number>
{
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(),
template <typename Number>
Vector<Number>::Vector(const Vector<Number> &v)
- : EnableObserverPointer()
{
*this = v;
}
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)
* 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());
/**
* 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,
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());
/**
* 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());
/**
* 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,
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());
/**
* 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());
/**
* 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());
/**
VectorBase::VectorBase(const VectorBase &v)
- : EnableObserverPointer()
- , ghosted(v.ghosted)
+ : ghosted(v.ghosted)
, ghost_indices(v.ghost_indices)
, last_action(VectorOperation::unknown)
{
VectorBase::VectorBase(const Vec &v)
- : EnableObserverPointer()
- , vector(v)
+ : vector(v)
, ghosted(false)
, last_action(VectorOperation::unknown)
{
# 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)))
{}
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();
namespace MPI
{
Vector::Vector()
- : EnableObserverPointer()
- , last_action(Zero)
+ : last_action(Zero)
, compressed(true)
, has_ghosts(false)
, vector(new Epetra_FEVector(
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)
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,
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)
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)
template <int dim>
- template <typename VectorType>
+ template <typename Number>
FEInterfaceValues<dim>::FEInterfaceValues(
const hp::MappingCollection<dim> &mapping_collection,
const hp::FECollection<dim> &fe_collection,
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)
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> &,
const RegionUpdateFlags,
const MeshClassifier<deal_II_dimension> &,
const DoFHandler<deal_II_dimension> &,
- const VEC &,
+ const ReadVector<S> &,
const typename FEValues<deal_II_dimension>::AdditionalData &);
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(
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(
const RegionUpdateFlags,
const MeshClassifier<deal_II_dimension> &,
const DoFHandler<deal_II_dimension> &,
- const VEC &,
+ const ReadVector<S> &,
const AdditionalData &);
}
* 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:
* 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()
* 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
* 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().
- 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)
- 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(
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)
{
- 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.
- 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
{
- 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
{
- 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
{
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))
{}
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))
{}
#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 &);
}