* @see
* @ref GlossBlockLA "Block (linear algebra)"
*/
- template <typename Number>
- class BlockVector : public BlockVectorBase<Vector<Number>>
+ template <typename Number, typename MemorySpace = MemorySpace::Host>
+ class BlockVector : public BlockVectorBase<Vector<Number, MemorySpace>>
{
public:
/**
/**
* Typedef the base class for simpler access to its own alias.
*/
- using BaseClass = BlockVectorBase<Vector<Number>>;
+ using BaseClass = BlockVectorBase<Vector<Number, MemorySpace>>;
/**
* Typedef the type of the underlying vector.
* Copy-Constructor. Dimension set to that of V, all components are
* copied from V
*/
- BlockVector(const BlockVector<Number> &V);
+ BlockVector(const BlockVector<Number, MemorySpace> &V);
/**
* Copy constructor taking a BlockVector of another data type. This will
* BlockVector with data elements with less accuracy.
*/
template <typename OtherNumber>
- explicit BlockVector(const BlockVector<OtherNumber> &v);
+ explicit BlockVector(const BlockVector<OtherNumber, MemorySpace> &v);
/**
* Constructor. Set the number of blocks to <tt>block_sizes.size()</tt>
*/
template <class Number2>
BlockVector &
- operator=(const BlockVector<Number2> &V);
+ operator=(const BlockVector<Number2, MemorySpace> &V);
/**
* Copy a regular vector into a block vector.
*/
BlockVector &
- operator=(const Vector<Number> &V);
+ operator=(const Vector<Number, MemorySpace> &V);
#ifdef DEAL_II_WITH_PETSC
/**
*
* This operator is only available if deal.II was configured with PETSc.
*/
- BlockVector<Number> &
+ BlockVector<Number, MemorySpace> &
operator=(const PETScWrappers::MPI::BlockVector &petsc_vec);
#endif
* This operator is only available if deal.II was configured with
* Trilinos.
*/
- BlockVector<Number> &
+ BlockVector<Number, MemorySpace> &
operator=(const TrilinosWrappers::MPI::BlockVector &trilinos_vec);
#endif
*/
template <typename Number2>
void
- reinit(const BlockVector<Number2> &V,
- const bool omit_zeroing_entries = false);
+ reinit(const BlockVector<Number2, MemorySpace> &V,
+ const bool omit_zeroing_entries = false);
/**
* Initialize the block vector. For each block, the local range is
*
* This function involves global communication, so it should only be
* called once for a given layout. Use the @p reinit function with
- * BlockVector<Number> argument to create additional vectors with the same
- * parallel layout.
+ * BlockVector<Number, MemorySpace> argument to create additional vectors
+ * with the same parallel layout.
*
* @see
* @ref GlossGhostedVector "vectors with ghost elements"
*/
template <typename Number2>
void
- copy_locally_owned_data_from(const BlockVector<Number2> &src);
+ copy_locally_owned_data_from(
+ const BlockVector<Number2, MemorySpace> &src);
/**
* This is a collective add operation that adds a whole set of values
* s*(*this)+V</tt>.
*/
void
- sadd(const Number s, const BlockVector<Number> &V);
+ sadd(const Number s, const BlockVector<Number, MemorySpace> &V);
/**
* Return whether the vector contains only elements with value zero.
* functions.
*/
void
- swap(BlockVector<Number> &v) noexcept;
+ swap(BlockVector<Number, MemorySpace> &v) noexcept;
/** @} */
/**
/**
* Multiply the entire vector by a fixed factor.
*/
- BlockVector<Number> &
+ BlockVector<Number, MemorySpace> &
operator*=(const Number factor);
/**
* Divide the entire vector by a fixed factor.
*/
- BlockVector<Number> &
+ BlockVector<Number, MemorySpace> &
operator/=(const Number factor);
/**
* Add the vector @p V to the present one.
*/
- BlockVector<Number> &
- operator+=(const BlockVector<Number> &V);
+ BlockVector<Number, MemorySpace> &
+ operator+=(const BlockVector<Number, MemorySpace> &V);
/**
* Subtract the vector @p V from the present one.
*/
- BlockVector<Number> &
- operator-=(const BlockVector<Number> &V);
+ BlockVector<Number, MemorySpace> &
+ operator-=(const BlockVector<Number, MemorySpace> &V);
/**
* Import all the elements present in the vector's IndexSet from the input
* Return the scalar product of two vectors.
*/
Number
- operator*(const BlockVector<Number> &V) const;
+ operator*(const BlockVector<Number, MemorySpace> &V) const;
/**
* Calculate the scalar product between each block of this vector and @p V
*/
template <typename FullMatrixType>
void
- multivector_inner_product(FullMatrixType &matrix,
- const BlockVector<Number> &V,
+ multivector_inner_product(FullMatrixType &matrix,
+ const BlockVector<Number, MemorySpace> &V,
const bool symmetric = false) const;
/**
*/
template <typename FullMatrixType>
Number
- multivector_inner_product_with_metric(const FullMatrixType &matrix,
- const BlockVector<Number> &V,
- const bool symmetric = false) const;
+ multivector_inner_product_with_metric(
+ const FullMatrixType &matrix,
+ const BlockVector<Number, MemorySpace> &V,
+ const bool symmetric = false) const;
/**
* Set each block of this vector as follows:
*/
template <typename FullMatrixType>
void
- mmult(BlockVector<Number> &V,
- const FullMatrixType &matrix,
- const Number s = Number(0.),
- const Number b = Number(1.)) const;
+ mmult(BlockVector<Number, MemorySpace> &V,
+ const FullMatrixType &matrix,
+ const Number s = Number(0.),
+ const Number b = Number(1.)) const;
/**
* Add @p a to all components. Note that @p a is a scalar not a vector.
* Simple addition of a multiple of a vector, i.e. <tt>*this += a*V</tt>.
*/
void
- add(const Number a, const BlockVector<Number> &V);
+ add(const Number a, const BlockVector<Number, MemorySpace> &V);
/**
* Multiple addition of scaled vectors, i.e. <tt>*this += a*V+b*W</tt>.
*/
void
- add(const Number a,
- const BlockVector<Number> &V,
- const Number b,
- const BlockVector<Number> &W);
+ add(const Number a,
+ const BlockVector<Number, MemorySpace> &V,
+ const Number b,
+ const BlockVector<Number, MemorySpace> &W);
/**
* A collective add operation: This function adds a whole set of values
* s*(*this)+a*V</tt>.
*/
void
- sadd(const Number s, const Number a, const BlockVector<Number> &V);
+ sadd(const Number s,
+ const Number a,
+ const BlockVector<Number, MemorySpace> &V);
/**
* Scale each element of this vector by the corresponding element in the
* immediate re-assignment) by a diagonal scaling matrix.
*/
void
- scale(const BlockVector<Number> &scaling_factors);
+ scale(const BlockVector<Number, MemorySpace> &scaling_factors);
/**
* Assignment <tt>*this = a*V</tt>.
*/
void
- equ(const Number a, const BlockVector<Number> &V);
+ equ(const Number a, const BlockVector<Number, MemorySpace> &V);
/**
* Return the l<sub>1</sub> norm of the vector (i.e., the sum of the
* $\left<v,w\right>=\sum_i v_i \bar{w_i}$.
*/
Number
- add_and_dot(const Number a,
- const BlockVector<Number> &V,
- const BlockVector<Number> &W);
+ add_and_dot(const Number a,
+ const BlockVector<Number, MemorySpace> &V,
+ const BlockVector<Number, MemorySpace> &W);
/**
* Return the global size of the vector, equal to the sum of the number of
*
* @relatesalso BlockVector
*/
-template <typename Number>
+template <typename Number, typename MemorySpace>
inline void
-swap(LinearAlgebra::distributed::BlockVector<Number> &u,
- LinearAlgebra::distributed::BlockVector<Number> &v) noexcept
+swap(LinearAlgebra::distributed::BlockVector<Number, MemorySpace> &u,
+ LinearAlgebra::distributed::BlockVector<Number, MemorySpace> &v) noexcept
{
u.swap(v);
}
* Declare dealii::LinearAlgebra::distributed::BlockVector as distributed
* vector.
*/
-template <typename Number>
-struct is_serial_vector<LinearAlgebra::distributed::BlockVector<Number>>
+template <typename Number, typename MemorySpace>
+struct is_serial_vector<
+ LinearAlgebra::distributed::BlockVector<Number, MemorySpace>>
: std::false_type
{};
{
namespace distributed
{
- template <typename Number>
- BlockVector<Number>::BlockVector(const size_type n_blocks,
- const size_type block_size)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace>::BlockVector(const size_type n_blocks,
+ const size_type block_size)
{
reinit(n_blocks, block_size);
}
- template <typename Number>
- BlockVector<Number>::BlockVector(const std::vector<size_type> &n)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace>::BlockVector(
+ const std::vector<size_type> &n)
{
reinit(n, false);
}
- template <typename Number>
- BlockVector<Number>::BlockVector(const std::vector<IndexSet> &local_ranges,
- const std::vector<IndexSet> &ghost_indices,
- const MPI_Comm communicator)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace>::BlockVector(
+ const std::vector<IndexSet> &local_ranges,
+ const std::vector<IndexSet> &ghost_indices,
+ const MPI_Comm communicator)
{
reinit(local_ranges, ghost_indices, communicator);
}
- template <typename Number>
- BlockVector<Number>::BlockVector(const std::vector<IndexSet> &local_ranges,
- const MPI_Comm communicator)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace>::BlockVector(
+ const std::vector<IndexSet> &local_ranges,
+ const MPI_Comm communicator)
{
reinit(local_ranges, communicator);
}
- template <typename Number>
- BlockVector<Number>::BlockVector(
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace>::BlockVector(
const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
&partitioners,
const MPI_Comm &comm_sm)
- template <typename Number>
- BlockVector<Number>::BlockVector(const BlockVector<Number> &v)
- : BlockVectorBase<Vector<Number>>()
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace>::BlockVector(
+ const BlockVector<Number, MemorySpace> &v)
+ : BlockVectorBase<Vector<Number, MemorySpace>>()
{
this->block_indices = v.block_indices;
- template <typename Number>
+ template <typename Number, typename MemorySpace>
template <typename OtherNumber>
- BlockVector<Number>::BlockVector(const BlockVector<OtherNumber> &v)
+ BlockVector<Number, MemorySpace>::BlockVector(
+ const BlockVector<OtherNumber, MemorySpace> &v)
{
reinit(v, true);
*this = v;
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::reinit(const size_type n_bl,
- const size_type bl_sz,
- const bool omit_zeroing_entries)
+ BlockVector<Number, MemorySpace>::reinit(const size_type n_bl,
+ const size_type bl_sz,
+ const bool omit_zeroing_entries)
{
std::vector<size_type> n(n_bl, bl_sz);
reinit(n, omit_zeroing_entries);
}
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::reinit(const std::vector<size_type> &block_sizes,
- const bool omit_zeroing_entries)
+ BlockVector<Number, MemorySpace>::reinit(
+ const std::vector<size_type> &block_sizes,
+ const bool omit_zeroing_entries)
{
this->block_indices.reinit(block_sizes);
- template <typename Number>
+ template <typename Number, typename MemorySpace>
template <typename Number2>
void
- BlockVector<Number>::reinit(const BlockVector<Number2> &v,
- const bool omit_zeroing_entries)
+ BlockVector<Number, MemorySpace>::reinit(
+ const BlockVector<Number2, MemorySpace> &v,
+ const bool omit_zeroing_entries)
{
if (this->n_blocks() != v.n_blocks())
this->block_indices = v.get_block_indices();
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::reinit(const std::vector<IndexSet> &local_ranges,
- const std::vector<IndexSet> &ghost_indices,
- const MPI_Comm communicator)
+ BlockVector<Number, MemorySpace>::reinit(
+ const std::vector<IndexSet> &local_ranges,
+ const std::vector<IndexSet> &ghost_indices,
+ const MPI_Comm communicator)
{
AssertDimension(local_ranges.size(), ghost_indices.size());
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::reinit(const std::vector<IndexSet> &local_ranges,
- const MPI_Comm communicator)
+ BlockVector<Number, MemorySpace>::reinit(
+ const std::vector<IndexSet> &local_ranges,
+ const MPI_Comm communicator)
{
// update the number of blocks
this->block_indices.reinit(local_ranges.size(), 0);
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::reinit(
+ BlockVector<Number, MemorySpace>::reinit(
const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
&partitioners,
const MPI_Comm &comm_sm)
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::reinit(
+ BlockVector<Number, MemorySpace>::reinit(
const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
&partitioners,
const bool /*make_ghosted*/,
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator=(const value_type s)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator=(const value_type s)
{
AssertIsFinite(s);
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator=(const BlockVector &v)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator=(const BlockVector &v)
{
// we only allow assignment to vectors with the same number of blocks
// or to an empty BlockVector
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator=(const Vector<Number> &v)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator=(
+ const Vector<Number, MemorySpace> &v)
{
BaseClass::operator=(v);
return *this;
- template <typename Number>
+ template <typename Number, typename MemorySpace>
template <typename Number2>
- BlockVector<Number> &
- BlockVector<Number>::operator=(const BlockVector<Number2> &v)
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator=(
+ const BlockVector<Number2, MemorySpace> &v)
{
reinit(v, true);
BaseClass::operator=(v);
- template <typename Number>
+ template <typename Number, typename MemorySpace>
template <typename Number2>
void
- BlockVector<Number>::copy_locally_owned_data_from(
- const BlockVector<Number2> &v)
+ BlockVector<Number, MemorySpace>::copy_locally_owned_data_from(
+ const BlockVector<Number2, MemorySpace> &v)
{
AssertDimension(this->n_blocks(), v.n_blocks());
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator=(
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator=(
const PETScWrappers::MPI::BlockVector &petsc_vec)
{
AssertDimension(this->n_blocks(), petsc_vec.n_blocks());
#ifdef DEAL_II_WITH_TRILINOS
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator=(
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator=(
const TrilinosWrappers::MPI::BlockVector &trilinos_vec)
{
AssertDimension(this->n_blocks(), trilinos_vec.n_blocks());
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::compress(VectorOperation::values operation)
+ BlockVector<Number, MemorySpace>::compress(
+ VectorOperation::values operation)
{
const unsigned int n_chunks =
(this->n_blocks() + communication_block_size - 1) /
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::update_ghost_values() const
+ BlockVector<Number, MemorySpace>::update_ghost_values() const
{
const unsigned int n_chunks =
(this->n_blocks() + communication_block_size - 1) /
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::zero_out_ghost_values() const
+ BlockVector<Number, MemorySpace>::zero_out_ghost_values() const
{
for (unsigned int block = 0; block < this->n_blocks(); ++block)
this->block(block).zero_out_ghost_values();
- template <typename Number>
+ template <typename Number, typename MemorySpace>
bool
- BlockVector<Number>::has_ghost_elements() const
+ BlockVector<Number, MemorySpace>::has_ghost_elements() const
{
bool has_ghost_elements = false;
for (unsigned int block = 0; block < this->n_blocks(); ++block)
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::set_ghost_state(const bool ghosted) const
+ BlockVector<Number, MemorySpace>::set_ghost_state(const bool ghosted) const
{
for (unsigned int block = 0; block < this->n_blocks(); ++block)
this->block(block).set_ghost_state(ghosted);
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator*=(const Number factor)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator*=(const Number factor)
{
for (unsigned int block = 0; block < this->n_blocks(); ++block)
this->block(block) *= factor;
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator/=(const Number factor)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator/=(const Number factor)
{
operator*=(static_cast<Number>(1.) / factor);
return *this;
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::scale(const BlockVector<Number> &v)
+ BlockVector<Number, MemorySpace>::scale(
+ const BlockVector<Number, MemorySpace> &v)
{
AssertDimension(this->n_blocks(), v.n_blocks());
for (unsigned int block = 0; block < this->n_blocks(); ++block)
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::equ(const Number a, const BlockVector<Number> &v)
+ BlockVector<Number, MemorySpace>::equ(
+ const Number a,
+ const BlockVector<Number, MemorySpace> &v)
{
AssertDimension(this->n_blocks(), v.n_blocks());
for (unsigned int block = 0; block < this->n_blocks(); ++block)
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator+=(const BlockVector<Number> &v)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator+=(
+ const BlockVector<Number, MemorySpace> &v)
{
AssertDimension(this->n_blocks(), v.n_blocks());
for (unsigned int block = 0; block < this->n_blocks(); ++block)
- template <typename Number>
- BlockVector<Number> &
- BlockVector<Number>::operator-=(const BlockVector<Number> &v)
+ template <typename Number, typename MemorySpace>
+ BlockVector<Number, MemorySpace> &
+ BlockVector<Number, MemorySpace>::operator-=(
+ const BlockVector<Number, MemorySpace> &v)
{
AssertDimension(this->n_blocks(), v.n_blocks());
for (unsigned int block = 0; block < this->n_blocks(); ++block)
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::add(const Number a)
+ BlockVector<Number, MemorySpace>::add(const Number a)
{
for (unsigned int block = 0; block < this->n_blocks(); ++block)
this->block(block).add(a);
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::add(const Number a, const BlockVector<Number> &v)
+ BlockVector<Number, MemorySpace>::add(
+ const Number a,
+ const BlockVector<Number, MemorySpace> &v)
{
AssertDimension(this->n_blocks(), v.n_blocks());
for (unsigned int block = 0; block < this->n_blocks(); ++block)
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::add(const Number a,
- const BlockVector<Number> &v,
- const Number b,
- const BlockVector<Number> &w)
+ BlockVector<Number, MemorySpace>::add(
+ const Number a,
+ const BlockVector<Number, MemorySpace> &v,
+ const Number b,
+ const BlockVector<Number, MemorySpace> &w)
{
AssertDimension(this->n_blocks(), v.n_blocks());
AssertDimension(this->n_blocks(), w.n_blocks());
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::sadd(const Number x,
- const Number a,
- const BlockVector<Number> &v)
+ BlockVector<Number, MemorySpace>::sadd(
+ const Number x,
+ const Number a,
+ const BlockVector<Number, MemorySpace> &v)
{
AssertDimension(this->n_blocks(), v.n_blocks());
for (unsigned int block = 0; block < this->n_blocks(); ++block)
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::sadd(const Number x, const BlockVector<Number> &v)
+ BlockVector<Number, MemorySpace>::sadd(
+ const Number x,
+ const BlockVector<Number, MemorySpace> &v)
{
AssertDimension(this->n_blocks(), v.n_blocks());
for (unsigned int block = 0; block < this->n_blocks(); ++block)
- template <typename Number>
+ template <typename Number, typename MemorySpace>
template <typename OtherNumber>
void
- BlockVector<Number>::add(const std::vector<size_type> &indices,
- const ::dealii::Vector<OtherNumber> &values)
+ BlockVector<Number, MemorySpace>::add(
+ const std::vector<size_type> &indices,
+ const ::dealii::Vector<OtherNumber> &values)
{
for (size_type i = 0; i < indices.size(); ++i)
(*this)(indices[i]) += values[i];
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::add(const std::vector<size_type> &indices,
- const std::vector<Number> &values)
+ BlockVector<Number, MemorySpace>::add(const std::vector<size_type> &indices,
+ const std::vector<Number> &values)
{
for (size_type i = 0; i < indices.size(); ++i)
(*this)(indices[i]) += values[i];
- template <typename Number>
+ template <typename Number, typename MemorySpace>
bool
- BlockVector<Number>::all_zero() const
+ BlockVector<Number, MemorySpace>::all_zero() const
{
Assert(this->n_blocks() > 0, ExcEmptyObject());
- template <typename Number>
+ template <typename Number, typename MemorySpace>
Number
- BlockVector<Number>::operator*(const BlockVector<Number> &v) const
+ BlockVector<Number, MemorySpace>::operator*(
+ const BlockVector<Number, MemorySpace> &v) const
{
Assert(this->n_blocks() > 0, ExcEmptyObject());
AssertDimension(this->n_blocks(), v.n_blocks());
- template <typename Number>
+ template <typename Number, typename MemorySpace>
inline Number
- BlockVector<Number>::mean_value() const
+ BlockVector<Number, MemorySpace>::mean_value() const
{
Assert(this->n_blocks() > 0, ExcEmptyObject());
- template <typename Number>
- inline typename BlockVector<Number>::real_type
- BlockVector<Number>::l1_norm() const
+ template <typename Number, typename MemorySpace>
+ inline typename BlockVector<Number, MemorySpace>::real_type
+ BlockVector<Number, MemorySpace>::l1_norm() const
{
Assert(this->n_blocks() > 0, ExcEmptyObject());
- template <typename Number>
- inline typename BlockVector<Number>::real_type
- BlockVector<Number>::norm_sqr() const
+ template <typename Number, typename MemorySpace>
+ inline typename BlockVector<Number, MemorySpace>::real_type
+ BlockVector<Number, MemorySpace>::norm_sqr() const
{
Assert(this->n_blocks() > 0, ExcEmptyObject());
- template <typename Number>
- inline typename BlockVector<Number>::real_type
- BlockVector<Number>::l2_norm() const
+ template <typename Number, typename MemorySpace>
+ inline typename BlockVector<Number, MemorySpace>::real_type
+ BlockVector<Number, MemorySpace>::l2_norm() const
{
return std::sqrt(norm_sqr());
}
- template <typename Number>
- inline typename BlockVector<Number>::real_type
- BlockVector<Number>::lp_norm(const real_type p) const
+ template <typename Number, typename MemorySpace>
+ inline typename BlockVector<Number, MemorySpace>::real_type
+ BlockVector<Number, MemorySpace>::lp_norm(const real_type p) const
{
Assert(this->n_blocks() > 0, ExcEmptyObject());
- template <typename Number>
- inline typename BlockVector<Number>::real_type
- BlockVector<Number>::linfty_norm() const
+ template <typename Number, typename MemorySpace>
+ inline typename BlockVector<Number, MemorySpace>::real_type
+ BlockVector<Number, MemorySpace>::linfty_norm() const
{
Assert(this->n_blocks() > 0, ExcEmptyObject());
- template <typename Number>
+ template <typename Number, typename MemorySpace>
inline Number
- BlockVector<Number>::add_and_dot(const Number a,
- const BlockVector<Number> &v,
- const BlockVector<Number> &w)
+ BlockVector<Number, MemorySpace>::add_and_dot(
+ const Number a,
+ const BlockVector<Number, MemorySpace> &v,
+ const BlockVector<Number, MemorySpace> &w)
{
AssertDimension(this->n_blocks(), v.n_blocks());
AssertDimension(this->n_blocks(), w.n_blocks());
- template <typename Number>
+ template <typename Number, typename MemorySpace>
inline void
- BlockVector<Number>::swap(BlockVector<Number> &v) noexcept
+ BlockVector<Number, MemorySpace>::swap(
+ BlockVector<Number, MemorySpace> &v) noexcept
{
Assert(this->n_blocks() == v.n_blocks(),
ExcDimensionMismatch(this->n_blocks(), v.n_blocks()));
- template <typename Number>
- typename BlockVector<Number>::size_type
- BlockVector<Number>::size() const
+ template <typename Number, typename MemorySpace>
+ typename BlockVector<Number, MemorySpace>::size_type
+ BlockVector<Number, MemorySpace>::size() const
{
return this->block_indices.total_size();
}
- template <typename Number>
+ template <typename Number, typename MemorySpace>
inline void
- BlockVector<Number>::import_elements(
+ BlockVector<Number, MemorySpace>::import_elements(
const LinearAlgebra::ReadWriteVector<Number> &,
const VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &)
- template <typename Number>
+ template <typename Number, typename MemorySpace>
IndexSet
- BlockVector<Number>::locally_owned_elements() const
+ BlockVector<Number, MemorySpace>::locally_owned_elements() const
{
IndexSet is(size());
return is;
}
- template <typename Number>
+ template <typename Number, typename MemorySpace>
void
- BlockVector<Number>::print(std::ostream &out,
- const unsigned int precision,
- const bool scientific,
- const bool across) const
+ BlockVector<Number, MemorySpace>::print(std::ostream &out,
+ const unsigned int precision,
+ const bool scientific,
+ const bool across) const
{
for (unsigned int b = 0; b < this->n_blocks(); ++b)
this->block(b).print(out, precision, scientific, across);
- template <typename Number>
+ template <typename Number, typename MemorySpace>
std::size_t
- BlockVector<Number>::memory_consumption() const
+ BlockVector<Number, MemorySpace>::memory_consumption() const
{
return (MemoryConsumption::memory_consumption(this->block_indices) +
MemoryConsumption::memory_consumption(this->components));
- template <typename Number>
+ template <typename Number, typename MemorySpace>
template <typename FullMatrixType>
void
- BlockVector<Number>::multivector_inner_product(FullMatrixType &matrix,
- const BlockVector<Number> &V,
- const bool symmetric) const
+ BlockVector<Number, MemorySpace>::multivector_inner_product(
+ FullMatrixType &matrix,
+ const BlockVector<Number, MemorySpace> &V,
+ const bool symmetric) const
{
const unsigned int m = this->n_blocks();
const unsigned int n = V.n_blocks();
- template <typename Number>
+ template <typename Number, typename MemorySpace>
template <typename FullMatrixType>
Number
- BlockVector<Number>::multivector_inner_product_with_metric(
- const FullMatrixType &matrix,
- const BlockVector<Number> &V,
- const bool symmetric) const
+ BlockVector<Number, MemorySpace>::multivector_inner_product_with_metric(
+ const FullMatrixType &matrix,
+ const BlockVector<Number, MemorySpace> &V,
+ const bool symmetric) const
{
Number res = Number(0.);
- template <typename Number>
+ template <typename Number, typename MemorySpace>
template <typename FullMatrixType>
void
- BlockVector<Number>::mmult(BlockVector<Number> &V,
- const FullMatrixType &matrix,
- const Number s,
- const Number b) const
+ BlockVector<Number, MemorySpace>::mmult(BlockVector<Number, MemorySpace> &V,
+ const FullMatrixType &matrix,
+ const Number s,
+ const Number b) const
{
const unsigned int m = this->n_blocks();
const unsigned int n = V.n_blocks();