const LinearAlgebra::distributed::Vector<number> &in)
{
LinearAlgebra::ReadWriteVector<double> rwv(out.locally_owned_elements());
- rwv.import(in, VectorOperation::insert);
+ rwv.import_elements(in, VectorOperation::insert);
#ifdef USE_PETSC_LA
AssertThrow(false,
ExcMessage("CopyVectorTypes::copy() not implemented for "
"PETSc vector types."));
#else
- out.import(rwv, VectorOperation::insert);
+ out.import_elements(rwv, VectorOperation::insert);
#endif
}
#else
rwv.reinit(in);
#endif
- out.import(rwv, VectorOperation::insert);
+ out.import_elements(rwv, VectorOperation::insert);
}
} // namespace ChangeVectorTypes
// Move the data to the device:
LinearAlgebra::CUDAWrappers::Vector<double> vector_dev(size);
- vector_dev.import(rw_vector, VectorOperations::insert);
+ vector_dev.import_elements(rw_vector, VectorOperations::insert);
...do some computations on the device...
// Move the data back to the host:
- rw_vector.import(vector_dev, VectorOperations::insert);
+ rw_vector.import_elements(vector_dev, VectorOperations::insert);
@endcode
Both of the vector classes used here only work on a single machine,
i.e., one memory space on a host and one on a device.
// Move the data to the device:
LinearAlgebra::distributed::Vector<double, MemorySpace::CUDA>
distributed_vector_dev(locally_owned_dofs, MPI_COMM_WORLD);
- distributed_vector_dev.import(owned_rw_vector, VectorOperations::insert);
+ distributed_vector_dev.import_elements(owned_rw_vector, VectorOperations::insert);
...do something with the dev_vector...
relevant_rw_vector(locally_relevant_dofs);
// Move the data to the host, possibly using MPI communication:
- relevant_rw_vector.import(distributed_vector_dev, VectorOperations::insert);
+ relevant_rw_vector.import_elements(distributed_vector_dev, VectorOperations::insert);
@endcode
The `relevant_rw_vector` is an object that stores a subset of all
elements of the vector. Typically, these are the
system_rhs_host.compress(VectorOperation::add);
LinearAlgebra::ReadWriteVector<double> rw_vector(locally_owned_dofs);
- rw_vector.import(system_rhs_host, VectorOperation::insert);
- system_rhs_dev.import(rw_vector, VectorOperation::insert);
+ rw_vector.import_elements(system_rhs_host, VectorOperation::insert);
+ system_rhs_dev.import_elements(rw_vector, VectorOperation::insert);
}
<< std::endl;
LinearAlgebra::ReadWriteVector<double> rw_vector(locally_owned_dofs);
- rw_vector.import(solution_dev, VectorOperation::insert);
- ghost_solution_host.import(rw_vector, VectorOperation::insert);
+ rw_vector.import_elements(solution_dev, VectorOperation::insert);
+ ghost_solution_host.import_elements(rw_vector, VectorOperation::insert);
constraints.distribute(ghost_solution_host);
index_set.add_indices(cache_indices.begin(), cache_indices.end());
index_set.compress();
LinearAlgebra::ReadWriteVector<Number> read_write_vector(index_set);
- read_write_vector.import(values, VectorOperation::insert);
+ read_write_vector.import_elements(values, VectorOperation::insert);
// Copy the elements from read_write_vector and reorder them.
for (unsigned int i = 0; i < cache_size; ++i, ++local_values_begin)
index_set.add_indices(cache_indices.begin(), cache_indices.end());
index_set.compress();
LinearAlgebra::ReadWriteVector<double> read_write_vector(index_set);
- read_write_vector.import(values, VectorOperation::insert);
+ read_write_vector.import_elements(values, VectorOperation::insert);
// Copy the elements from read_write_vector and reorder them.
for (unsigned int i = 0; i < cache_size; ++i, ++local_values_begin)
* copy a vector to the GPU.
*/
virtual void
- import(const ReadWriteVector<Number> &V,
- VectorOperation::values operation,
- std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- communication_pattern = {}) override;
+ import_elements(
+ const ReadWriteVector<Number> &V,
+ VectorOperation::values operation,
+ std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ communication_pattern = {}) override;
/**
* Sets all elements of the vector to the scalar @p s. This operation is
* improve performance.
*/
virtual void
- import(const LinearAlgebra::ReadWriteVector<Number> &V,
- VectorOperation::values operation,
- std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- communication_pattern = {}) override;
+ import_elements(
+ const LinearAlgebra::ReadWriteVector<Number> &V,
+ VectorOperation::values operation,
+ std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ communication_pattern = {}) override;
/**
* Return the scalar product of two vectors.
IndexSet combined_set = partitioner->locally_owned_range();
combined_set.add_indices(partitioner->ghost_indices());
ReadWriteVector<Number> rw_vector(combined_set);
- rw_vector.import(trilinos_vec.block(i), VectorOperation::insert);
- this->block(i).import(rw_vector, VectorOperation::insert);
+ rw_vector.import_elements(trilinos_vec.block(i),
+ VectorOperation::insert);
+ this->block(i).import_elements(rw_vector, VectorOperation::insert);
if (this->block(i).has_ghost_elements() ||
trilinos_vec.block(i).has_ghost_elements())
template <typename Number>
inline void
- BlockVector<Number>::import(
+ BlockVector<Number>::import_elements(
const LinearAlgebra::ReadWriteVector<Number> &,
VectorOperation::values,
std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>)
* Kokkos::View<double,
* MemorySpace::Default::kokkos_space>( vector_dev, n_local_elements));
* @endcode
- * <li> use import():
+ * <li> use import_elements():
* @code
* Vector<double, MemorySpace::Default> vector(local_range, comm);
* ReadWriteVector<double> rw_vector(local_range);
* for (auto & val : rw_vector)
* val = 1.;
- * vector.import(rw_vector, VectorOperations::insert);
+ * vector.import_elements(rw_vector, VectorOperations::insert);
* @endcode
* </ul>
* The import method is a lot safer and will perform an MPI communication if
*/
template <typename MemorySpace2>
void
- import(const Vector<Number, MemorySpace2> &src,
- VectorOperation::values operation);
+ import_elements(const Vector<Number, MemorySpace2> &src,
+ VectorOperation::values operation);
/** @} */
* be moved to the @ref GlossDevice "device".
*/
virtual void
- import(const LinearAlgebra::ReadWriteVector<Number> &V,
- VectorOperation::values operation,
- std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- communication_pattern = {}) override;
+ import_elements(
+ const LinearAlgebra::ReadWriteVector<Number> &V,
+ VectorOperation::values operation,
+ std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ communication_pattern = {}) override;
/**
* Return the scalar product of two vectors.
template <typename Number, typename MemorySpaceType>
template <typename MemorySpaceType2>
void
- Vector<Number, MemorySpaceType>::import(
+ Vector<Number, MemorySpaceType>::import_elements(
const Vector<Number, MemorySpaceType2> &src,
VectorOperation::values operation)
{
template <typename Number, typename MemorySpaceType>
void
- Vector<Number, MemorySpaceType>::import(
+ Vector<Number, MemorySpaceType>::import_elements(
const ReadWriteVector<Number> &V,
VectorOperation::values operation,
std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
* This function is not implemented and will throw an exception.
*/
virtual void
- import(const ReadWriteVector<Number> &V,
- VectorOperation::values operation,
- std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- communication_pattern = {}) override;
+ import_elements(
+ const ReadWriteVector<Number> &V,
+ VectorOperation::values operation,
+ std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ communication_pattern = {}) override;
/**
* Add @p a to all components. Note that @p a is a scalar not a vector.
template <typename Number>
void
- Vector<Number>::import(
+ Vector<Number>::import_elements(
const ReadWriteVector<Number> &,
VectorOperation::values,
std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>)
* dealing with a serial vector here.
*/
void
- import(const dealii::Vector<Number> &vec,
- VectorOperation::values operation,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern = {});
+ import_elements(
+ const dealii::Vector<Number> &vec,
+ VectorOperation::values operation,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern = {});
/**
* Imports all the elements present in the vector's IndexSet from the
* dealing with a serial vector here.
*/
void
- import(const LinearAlgebra::Vector<Number> &vec,
- VectorOperation::values operation,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern = {});
+ import_elements(
+ const LinearAlgebra::Vector<Number> &vec,
+ VectorOperation::values operation,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern = {});
/**
* Imports all the elements present in the vector's IndexSet from the
*/
template <typename MemorySpace>
void
- import(const distributed::Vector<Number, MemorySpace> &vec,
- VectorOperation::values operation,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern = {});
+ import_elements(
+ const distributed::Vector<Number, MemorySpace> &vec,
+ VectorOperation::values operation,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern = {});
#ifdef DEAL_II_WITH_PETSC
/**
* performance.
*/
void
- import(const PETScWrappers::MPI::Vector &petsc_vec,
- VectorOperation::values operation,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern = {});
+ import_elements(
+ const PETScWrappers::MPI::Vector &petsc_vec,
+ VectorOperation::values operation,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern = {});
#endif
#ifdef DEAL_II_WITH_TRILINOS
* @note The @p trilinos_vec is not allowed to have ghost entries.
*/
void
- import(const TrilinosWrappers::MPI::Vector &trilinos_vec,
- VectorOperation::values operation,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern = {});
+ import_elements(
+ const TrilinosWrappers::MPI::Vector &trilinos_vec,
+ VectorOperation::values operation,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern = {});
# ifdef DEAL_II_TRILINOS_WITH_TPETRA
/**
template <typename Dummy = Number>
std::enable_if_t<std::is_same<Dummy, Number>::value &&
dealii::is_tpetra_type<Number>::value>
- import(const TpetraWrappers::Vector<Number> &tpetra_vec,
- VectorOperation::values operation,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern = {});
+ import_elements(
+ const TpetraWrappers::Vector<Number> &tpetra_vec,
+ VectorOperation::values operation,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern = {});
# endif
/**
* performance.
*/
void
- import(const EpetraWrappers::Vector &epetra_vec,
- VectorOperation::values operation,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern = {});
+ import_elements(
+ const EpetraWrappers::Vector &epetra_vec,
+ VectorOperation::values operation,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern = {});
#endif
#ifdef DEAL_II_WITH_CUDA
* replace the current elements. The last parameter is not used.
*/
void
- import(const CUDAWrappers::Vector<Number> &cuda_vec,
- VectorOperation::values operation,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern = {});
+ import_elements(
+ const CUDAWrappers::Vector<Number> &cuda_vec,
+ VectorOperation::values operation,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern = {});
#endif
/**
template <typename Dummy = Number>
std::enable_if_t<std::is_same<Dummy, Number>::value &&
dealii::is_tpetra_type<Number>::value>
- import(const Tpetra::Vector<Number, int, types::signed_global_dof_index>
- & tpetra_vector,
- const IndexSet & locally_owned_elements,
- VectorOperation::values operation,
- const MPI_Comm mpi_comm,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern);
+ import_elements(
+ const Tpetra::Vector<Number, int, types::signed_global_dof_index>
+ & tpetra_vector,
+ const IndexSet & locally_owned_elements,
+ VectorOperation::values operation,
+ const MPI_Comm mpi_comm,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern);
# endif
/**
* used directly.
*/
void
- import(const Epetra_MultiVector &multivector,
- const IndexSet & locally_owned_elements,
- VectorOperation::values operation,
- const MPI_Comm mpi_comm,
- const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- &communication_pattern);
+ import_elements(
+ const Epetra_MultiVector &multivector,
+ const IndexSet & locally_owned_elements,
+ VectorOperation::values operation,
+ const MPI_Comm mpi_comm,
+ const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ &communication_pattern);
#endif
/**
struct read_write_vector_functions
{
static void
- import(const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
- & communication_pattern,
- const Number * values,
- const VectorOperation::values operation,
- ::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
+ import_elements(
+ const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
+ & communication_pattern,
+ const Number * values,
+ const VectorOperation::values operation,
+ ::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
{
(void)communication_pattern;
(void)values;
static void
- import(const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
- & communication_pattern,
- const Number * values,
- const VectorOperation::values operation,
- ::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
+ import_elements(
+ const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
+ & communication_pattern,
+ const Number * values,
+ const VectorOperation::values operation,
+ ::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
{
distributed::Vector<Number, ::dealii::MemorySpace::Host> tmp_vector(
communication_pattern);
using size_type = types::global_dof_index;
static void
- import(const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
- & communication_pattern,
- const Number * values,
- const VectorOperation::values operation,
- ::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
+ import_elements(
+ const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
+ & communication_pattern,
+ const Number * values,
+ const VectorOperation::values operation,
+ ::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
{
distributed::Vector<Number, ::dealii::MemorySpace::Host> tmp_vector(
communication_pattern);
template <typename Number>
void
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const dealii::Vector<Number> &vec,
VectorOperation::values operation,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
template <typename Number>
void
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const LinearAlgebra::Vector<Number> &vec,
VectorOperation::values operation,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
template <typename Number>
template <typename MemorySpace>
void
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const distributed::Vector<Number, MemorySpace> &vec,
VectorOperation::values operation,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
}
- internal::read_write_vector_functions<Number, MemorySpace>::import(
+ internal::read_write_vector_functions<Number, MemorySpace>::import_elements(
comm_pattern, vec.begin(), operation, *this);
}
template <typename Number>
void
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const PETScWrappers::MPI::Vector &petsc_vec,
VectorOperation::values /*operation*/,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
template <typename Dummy>
std::enable_if_t<std::is_same<Dummy, Number>::value &&
dealii::is_tpetra_type<Number>::value>
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const Tpetra::Vector<Number, int, types::signed_global_dof_index> &vector,
const IndexSet & source_elements,
VectorOperation::values operation,
template <typename Number>
void
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const Epetra_MultiVector &multivector,
const IndexSet & source_elements,
VectorOperation::values operation,
template <typename Number>
void
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const TrilinosWrappers::MPI::Vector &trilinos_vec,
VectorOperation::values operation,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
!trilinos_vec.has_ghost_elements(),
ExcMessage(
"Import() from TrilinosWrappers::MPI::Vector with ghost entries is not supported!"));
- import(trilinos_vec.trilinos_vector(),
- trilinos_vec.locally_owned_elements(),
- operation,
- trilinos_vec.get_mpi_communicator(),
- communication_pattern);
+ import_elements(trilinos_vec.trilinos_vector(),
+ trilinos_vec.locally_owned_elements(),
+ operation,
+ trilinos_vec.get_mpi_communicator(),
+ communication_pattern);
}
template <typename Dummy>
std::enable_if_t<std::is_same<Dummy, Number>::value &&
dealii::is_tpetra_type<Number>::value>
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const LinearAlgebra::TpetraWrappers::Vector<Number> &trilinos_vec,
VectorOperation::values operation,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
&communication_pattern)
{
- import(trilinos_vec.trilinos_vector(),
- trilinos_vec.locally_owned_elements(),
- operation,
- trilinos_vec.get_mpi_communicator(),
- communication_pattern);
+ import_elements(trilinos_vec.trilinos_vector(),
+ trilinos_vec.locally_owned_elements(),
+ operation,
+ trilinos_vec.get_mpi_communicator(),
+ communication_pattern);
}
# endif
template <typename Number>
void
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const LinearAlgebra::EpetraWrappers::Vector &trilinos_vec,
VectorOperation::values operation,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
&communication_pattern)
{
- import(trilinos_vec.trilinos_vector(),
- trilinos_vec.locally_owned_elements(),
- operation,
- trilinos_vec.get_mpi_communicator(),
- communication_pattern);
+ import_elements(trilinos_vec.trilinos_vector(),
+ trilinos_vec.locally_owned_elements(),
+ operation,
+ trilinos_vec.get_mpi_communicator(),
+ communication_pattern);
}
#endif
#ifdef DEAL_II_WITH_CUDA
template <typename Number>
void
- ReadWriteVector<Number>::import(
+ ReadWriteVector<Number>::import_elements(
const LinearAlgebra::CUDAWrappers::Vector<Number> &cuda_vec,
VectorOperation::values operation,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &)
* improve performance.
*/
virtual void
- import(const ReadWriteVector<double> &V,
- VectorOperation::values operation,
- std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- communication_pattern = {}) override;
+ import_elements(
+ const ReadWriteVector<double> &V,
+ VectorOperation::values operation,
+ std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ communication_pattern = {}) override;
/**
* Multiply the entire vector by a fixed factor.
* improve performance.
*/
virtual void
- import(const ReadWriteVector<Number> &V,
- VectorOperation::values operation,
- std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- communication_pattern = {}) override;
+ import_elements(
+ const ReadWriteVector<Number> &V,
+ VectorOperation::values operation,
+ std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ communication_pattern = {}) override;
/**
* Multiply the entire vector by a fixed factor.
template <typename Number>
void
- Vector<Number>::import(
+ Vector<Number>::import_elements(
const ReadWriteVector<Number> &V,
VectorOperation::values operation,
std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
* current elements.
*/
void
- import(const LinearAlgebra::ReadWriteVector<double> &rwv,
- const VectorOperation::values operation);
+ import_elements(const LinearAlgebra::ReadWriteVector<double> &rwv,
+ const VectorOperation::values operation);
/**
* performance.
*/
virtual void
- import(const ReadWriteVector<Number> &V,
- VectorOperation::values operation,
- std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
- communication_pattern = {}) = 0;
+ import_elements(
+ const ReadWriteVector<Number> &V,
+ VectorOperation::values operation,
+ std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
+ communication_pattern = {}) = 0;
/**
* Return the scalar product of two vectors.
{
LinearAlgebra::ReadWriteVector<typename VectorType::value_type> temp;
temp.reinit(src.locally_owned_elements());
- temp.import(src, VectorOperation::insert);
+ temp.import_elements(src, VectorOperation::insert);
LinearAlgebra::ReadWriteVector<Number> temp2;
temp2.reinit(temp, true);
temp2 = temp;
- dst.import(temp2, VectorOperation::insert);
+ dst.import_elements(temp2, VectorOperation::insert);
}
#ifdef DEAL_II_WITH_TRILINOS
{
LinearAlgebra::ReadWriteVector<typename VectorType::value_type> temp;
temp.reinit(vector.locally_owned_elements());
- temp.import(vector, VectorOperation::insert);
- vector_ghosted.import(temp, VectorOperation::insert);
+ temp.import_elements(vector, VectorOperation::insert);
+ vector_ghosted.import_elements(temp, VectorOperation::insert);
}
} // namespace
template <typename Number>
void
- Vector<Number>::import(
+ Vector<Number>::import_elements(
const ReadWriteVector<Number> &V,
VectorOperation::values operation,
std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>)
#ifndef DOXYGEN
template void
- Vector<float, ::dealii::MemorySpace::Host>::import<
+ Vector<float, ::dealii::MemorySpace::Host>::import_elements<
::dealii::MemorySpace::Default>(
const Vector<float, ::dealii::MemorySpace::Default> &,
VectorOperation::values);
template void
- Vector<double, ::dealii::MemorySpace::Host>::import<
+ Vector<double, ::dealii::MemorySpace::Host>::import_elements<
::dealii::MemorySpace::Default>(
const Vector<double, ::dealii::MemorySpace::Default> &,
VectorOperation::values);
template void
- Vector<float, ::dealii::MemorySpace::Default>::import<
+ Vector<float, ::dealii::MemorySpace::Default>::import_elements<
::dealii::MemorySpace::Host>(
const Vector<float, ::dealii::MemorySpace::Host> &,
VectorOperation::values);
template void
- Vector<double, ::dealii::MemorySpace::Default>::import<
+ Vector<double, ::dealii::MemorySpace::Default>::import_elements<
::dealii::MemorySpace::Host>(
const Vector<double, ::dealii::MemorySpace::Host> &,
VectorOperation::values);
template void
- Vector<float, ::dealii::MemorySpace::Default>::import<
+ Vector<float, ::dealii::MemorySpace::Default>::import_elements<
::dealii::MemorySpace::Default>(
const Vector<float, ::dealii::MemorySpace::Default> &,
VectorOperation::values);
template void
- Vector<double, ::dealii::MemorySpace::Default>::import<
+ Vector<double, ::dealii::MemorySpace::Default>::import_elements<
::dealii::MemorySpace::Default>(
const Vector<double, ::dealii::MemorySpace::Default> &,
VectorOperation::values);
\{
template class Vector<SCALAR, ::dealii::MemorySpace::Host>;
template void
- Vector<SCALAR, ::dealii::MemorySpace::Host>::import<
+ Vector<SCALAR, ::dealii::MemorySpace::Host>::import_elements<
::dealii::MemorySpace::Host>(
const Vector<SCALAR, ::dealii::MemorySpace::Host> &,
VectorOperation::values);
#ifndef DOXYGEN
template void
- ReadWriteVector<float>::import(
+ ReadWriteVector<float>::import_elements(
const distributed::Vector<float, ::dealii::MemorySpace::Host> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
template void
- ReadWriteVector<float>::import(
+ ReadWriteVector<float>::import_elements(
const distributed::Vector<float, ::dealii::MemorySpace::Default> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
template void
- ReadWriteVector<double>::import(
+ ReadWriteVector<double>::import_elements(
const distributed::Vector<double, ::dealii::MemorySpace::Host> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
template void
- ReadWriteVector<double>::import(
+ ReadWriteVector<double>::import_elements(
const distributed::Vector<double, ::dealii::MemorySpace::Default> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
# ifdef DEAL_II_WITH_COMPLEX_VALUES
template void
- ReadWriteVector<std::complex<float>>::import(
+ ReadWriteVector<std::complex<float>>::import_elements(
const distributed::Vector<std::complex<float>, ::dealii::MemorySpace::Host>
&,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
template void
- ReadWriteVector<std::complex<double>>::import(
+ ReadWriteVector<std::complex<double>>::import_elements(
const distributed::Vector<std::complex<double>, ::dealii::MemorySpace::Host>
&,
VectorOperation::values,
# ifdef HAVE_TPETRA_INST_FLOAT
template void
- ReadWriteVector<float>::import(
+ ReadWriteVector<float>::import_elements(
const LinearAlgebra::TpetraWrappers::Vector<float> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
# endif
# ifdef HAVE_TPETRA_INST_DOUBLE
template void
- ReadWriteVector<double>::import(
+ ReadWriteVector<double>::import_elements(
const LinearAlgebra::TpetraWrappers::Vector<double> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
# ifdef DEAL_II_WITH_COMPLEX_VALUES
# ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
template void
- ReadWriteVector<std::complex<float>>::import(
+ ReadWriteVector<std::complex<float>>::import_elements(
const LinearAlgebra::TpetraWrappers::Vector<std::complex<float>> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
# endif
# ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
template void
- ReadWriteVector<std::complex<double>>::import(
+ ReadWriteVector<std::complex<double>>::import_elements(
const LinearAlgebra::TpetraWrappers::Vector<std::complex<double>> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
namespace LinearAlgebra
{
template void
- ReadWriteVector<float>::import(
+ ReadWriteVector<float>::import_elements(
const CUDAWrappers::Vector<float> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
template void
- ReadWriteVector<float>::import(
+ ReadWriteVector<float>::import_elements(
const distributed::Vector<float, ::dealii::MemorySpace::CUDA> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
template void
- ReadWriteVector<double>::import(
+ ReadWriteVector<double>::import_elements(
const CUDAWrappers::Vector<double> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
template void
- ReadWriteVector<double>::import(
+ ReadWriteVector<double>::import_elements(
const distributed::Vector<double, ::dealii::MemorySpace::CUDA> &,
VectorOperation::values,
const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
void
- Vector::import(
+ Vector::import_elements(
const ReadWriteVector<double> &V,
VectorOperation::values operation,
std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
void
- Vector::import(const LinearAlgebra::ReadWriteVector<double> &rwv,
- const VectorOperation::values operation)
+ Vector::import_elements(const LinearAlgebra::ReadWriteVector<double> &rwv,
+ const VectorOperation::values operation)
{
Assert(
this->size() == rwv.size(),
ExcMessage(
- "Both vectors need to have the same size for import() to work!"));
- // TODO: a generic import() function should handle any kind of data layout
- // in ReadWriteVector, but this function is of limited use as this class
- // will (hopefully) be retired eventually.
+ "Both vectors need to have the same size for import_elements() to work!"));
+ // TODO: a generic import_elements() function should handle any kind of
+ // data layout in ReadWriteVector, but this function is of limited use as
+ // this class will (hopefully) be retired eventually.
Assert(this->locally_owned_elements() == rwv.get_stored_elements(),
ExcNotImplemented());
dof_handler.get_communicator());
LinearAlgebra::ReadWriteVector<Number> x_temp(
dof_handler.locally_owned_dofs());
- x_temp.import(x, VectorOperation::insert);
- x_.import(x_temp, VectorOperation::insert);
+ x_temp.import_elements(x, VectorOperation::insert);
+ x_.import_elements(x_temp, VectorOperation::insert);
LinearAlgebra::EpetraWrappers::Vector r_(dof_handler.locally_owned_dofs(),
dof_handler.get_communicator());
LinearAlgebra::ReadWriteVector<Number> r_temp(
dof_handler.locally_owned_dofs());
- r_temp.import(r, VectorOperation::insert);
- r_.import(r_temp, VectorOperation::insert);
+ r_temp.import_elements(r, VectorOperation::insert);
+ r_.import_elements(r_temp, VectorOperation::insert);
X = Teuchos::rcp<Epetra_MultiVector>(&x_.trilinos_vector(), false);
B = Teuchos::rcp<Epetra_MultiVector>(&r_.trilinos_vector(), false);
mf.eval(coef_device);
cudaDeviceSynchronize();
- coef.import(coef_device, VectorOperation::insert);
+ coef.import_elements(coef_device, VectorOperation::insert);
// Computation the host
auto graph = mf_data.get_colored_graph();
Kokkos::deep_copy(x_dev, x_host);
Kokkos::deep_copy(y_dev, y_host);
-
Kokkos::View<double *, MemorySpace::Default::kokkos_space> shape_values(
Kokkos::view_alloc("shape_values", Kokkos::WithoutInitializing),
size_shape_values);
read_write_2[i] = 5. + i;
}
- a.import(read_write_2, VectorOperation::insert);
- b.import(read_write_1, VectorOperation::insert);
- c.import(read_write_2, VectorOperation::insert);
+ a.import_elements(read_write_2, VectorOperation::insert);
+ b.import_elements(read_write_1, VectorOperation::insert);
+ c.import_elements(read_write_2, VectorOperation::insert);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(read_write_2[i] == read_write_3[i],
ExcMessage("Vector a has been modified."));
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(read_write_1[i] == read_write_3[i],
ExcMessage("Vector b has been modified."));
- read_write_3.import(c, VectorOperation::insert);
+ read_write_3.import_elements(c, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(read_write_2[i] == read_write_3[i],
ExcMessage("Vector c has been modified."));
a *= 2.;
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(2. * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in operator *=."));
c /= 2.;
- read_write_3.import(c, VectorOperation::insert);
+ read_write_3.import_elements(c, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(0.5 * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in operator /=."));
b += a;
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(2. * read_write_2[i] + read_write_1[i] == read_write_3[i],
ExcMessage("Problem in operator +=."));
b -= c;
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(1.5 * read_write_2[i] + read_write_1[i] == read_write_3[i],
ExcMessage("Problem in operator -=."));
- b.import(read_write_1, VectorOperation::insert);
- c.import(read_write_1, VectorOperation::insert);
+ b.import_elements(read_write_1, VectorOperation::insert);
+ c.import_elements(read_write_1, VectorOperation::insert);
const double val = b * c;
AssertThrow(val == 328350., ExcMessage("Problem in operator *."));
b = 0.;
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(read_write_3[i] == 0., ExcMessage("Problem in operator =."));
}
read_write_2[i] = 5. + i;
}
- a.import(read_write_1, VectorOperation::insert);
- b.import(read_write_2, VectorOperation::insert);
- c.import(read_write_2, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
+ b.import_elements(read_write_2, VectorOperation::insert);
+ c.import_elements(read_write_2, VectorOperation::insert);
a.add(1.);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(1. + read_write_1[i] == read_write_3[i],
ExcMessage("Problem in add(scalar)."));
a.add(2., b);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(1. + read_write_1[i] + 2. * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in add(scalar,Vector)."));
LinearAlgebra::CUDAWrappers::Vector<double> d(a);
a.add(2., b, 3., d);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(4. + 4. * read_write_1[i] + 10. * read_write_2[i] ==
read_write_3[i],
ExcMessage("Problem in add(scalar,Vector,scalar,Vector)."));
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
a.sadd(3., 2., c);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(3. * read_write_1[i] + 2. * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in sadd(scalar,scalar,Vector)."));
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
a.scale(b);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(read_write_1[i] * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in scale."));
a.equ(2., c);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(2. * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in equ."));
AssertThrow(b.linfty_norm() == 104., ExcMessage("Problem in linfty_norm."));
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
const double val = a.add_and_dot(2., a, b);
AssertThrow(val == 1059300., ExcMessage("Problem in add_and_dot"));
}
LinearAlgebra::ReadWriteVector<double> read_write(size);
for (unsigned int i = 0; i < size; ++i)
read_write[i] = i;
- a.import(read_write, VectorOperation::insert);
+ a.import_elements(read_write, VectorOperation::insert);
a.reinit(size / 2);
AssertThrow(a.l1_norm() == 0., ExcMessage("reinit did not zero the entry"));
read_write_1[i] = i;
}
- cuda_vector.import(read_write_1, VectorOperation::insert);
+ cuda_vector.import_elements(read_write_1, VectorOperation::insert);
cuda_vector.print(deallog.get_file_stream());
}
b_host[i] = 5. + i;
}
- a.import(read_write_1, VectorOperation::insert);
- b.import(read_write_2, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
+ b.import_elements(read_write_2, VectorOperation::insert);
AssertThrow(a.add_and_dot(2., a, b) == a_host.add_and_dot(2., a_host, b_host),
ExcMessage("Problem in add_and_dot"));
}
continue;
rw_in.local_element(i) = random_value<double>();
}
- in_dev.import(rw_in, VectorOperation::insert);
+ in_dev.import_elements(rw_in, VectorOperation::insert);
mf.vmult(out_dev, in_dev);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> out_host(
owned_set, MPI_COMM_WORLD);
LinearAlgebra::ReadWriteVector<Number> rw_out(owned_set);
- rw_out.import(out_dev, VectorOperation::insert);
- out_host.import(rw_out, VectorOperation::insert);
+ rw_out.import_elements(out_dev, VectorOperation::insert);
+ out_host.import_elements(rw_out, VectorOperation::insert);
// assemble trilinos sparse matrix with
// (\nabla v, \nabla u) + (v, 10 * u) for
// reference
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> in_host(
owned_set, MPI_COMM_WORLD);
- in_host.import(rw_in, VectorOperation::insert);
+ in_host.import_elements(rw_in, VectorOperation::insert);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> ref(
owned_set, MPI_COMM_WORLD);
TrilinosWrappers::SparseMatrix sparse_matrix;
continue;
rw_in.local_element(i) = random_value<double>();
}
- in_dev.import(rw_in, VectorOperation::insert);
+ in_dev.import_elements(rw_in, VectorOperation::insert);
mf.vmult(out_dev, in_dev);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> out_host(
owned_set, MPI_COMM_WORLD);
LinearAlgebra::ReadWriteVector<Number> rw_out(owned_set);
- rw_out.import(out_dev, VectorOperation::insert);
- out_host.import(rw_out, VectorOperation::insert);
+ rw_out.import_elements(out_dev, VectorOperation::insert);
+ out_host.import_elements(rw_out, VectorOperation::insert);
// assemble trilinos sparse matrix with
// (\nabla v, \nabla u) + (v, coef * u) for
// reference
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> in_host(
owned_set, MPI_COMM_WORLD);
- in_host.import(rw_in, VectorOperation::insert);
+ in_host.import_elements(rw_in, VectorOperation::insert);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> ref(
owned_set, MPI_COMM_WORLD);
TrilinosWrappers::SparseMatrix sparse_matrix;
continue;
rw_in.local_element(i) = random_value<double>();
}
- in_dev.import(rw_in, VectorOperation::insert);
+ in_dev.import_elements(rw_in, VectorOperation::insert);
mf.vmult(out_dev, in_dev);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> out_host(
owned_set, MPI_COMM_WORLD);
LinearAlgebra::ReadWriteVector<Number> rw_out(owned_set);
- rw_out.import(out_dev, VectorOperation::insert);
- out_host.import(rw_out, VectorOperation::insert);
+ rw_out.import_elements(out_dev, VectorOperation::insert);
+ out_host.import_elements(rw_out, VectorOperation::insert);
// assemble trilinos sparse matrix with
// (\nabla v, \nabla u) + (v, 10 * u) for
// reference
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> in_host(
owned_set, MPI_COMM_WORLD);
- in_host.import(rw_in, VectorOperation::insert);
+ in_host.import_elements(rw_in, VectorOperation::insert);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> ref(
owned_set, MPI_COMM_WORLD);
TrilinosWrappers::SparseMatrix sparse_matrix;
continue;
rw_in.local_element(i) = random_value<double>();
}
- in_dev.import(rw_in, VectorOperation::insert);
+ in_dev.import_elements(rw_in, VectorOperation::insert);
mf.vmult(out_dev, in_dev);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> out_host(
owned_set, MPI_COMM_WORLD);
LinearAlgebra::ReadWriteVector<Number> rw_out(owned_set);
- rw_out.import(out_dev, VectorOperation::insert);
- out_host.import(rw_out, VectorOperation::insert);
+ rw_out.import_elements(out_dev, VectorOperation::insert);
+ out_host.import_elements(rw_out, VectorOperation::insert);
// assemble trilinos sparse matrix with
// (\nabla v, \nabla u) + (v, 10 * u) for
// reference
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> in_host(
owned_set, MPI_COMM_WORLD);
- in_host.import(rw_in, VectorOperation::insert);
+ in_host.import_elements(rw_in, VectorOperation::insert);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> ref(
owned_set, MPI_COMM_WORLD);
TrilinosWrappers::SparseMatrix sparse_matrix;
continue;
rw_in.local_element(i) = random_value<double>();
}
- in_dev.import(rw_in, VectorOperation::insert);
+ in_dev.import_elements(rw_in, VectorOperation::insert);
mf.vmult(out_dev, in_dev);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> out_host(
owned_set, MPI_COMM_WORLD);
LinearAlgebra::ReadWriteVector<Number> rw_out(owned_set);
- rw_out.import(out_dev, VectorOperation::insert);
- out_host.import(rw_out, VectorOperation::insert);
+ rw_out.import_elements(out_dev, VectorOperation::insert);
+ out_host.import_elements(rw_out, VectorOperation::insert);
// assemble trilinos sparse matrix with
// (\nabla v, \nabla u) + (v, 10 * u) for
// reference
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> in_host(
owned_set, MPI_COMM_WORLD);
- in_host.import(rw_in, VectorOperation::insert);
+ in_host.import_elements(rw_in, VectorOperation::insert);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> ref(
owned_set, MPI_COMM_WORLD);
TrilinosWrappers::SparseMatrix sparse_matrix;
in(i) = entry;
}
- in_device.import(in, VectorOperation::insert);
+ in_device.import_elements(in, VectorOperation::insert);
mf.vmult(out_device, in_device);
cudaDeviceSynchronize();
- out.import(out_device, VectorOperation::insert);
+ out.import_elements(out_device, VectorOperation::insert);
// assemble sparse matrix with (\nabla v, \nabla u) + (v, 10 * u)
SparsityPattern sparsity;
in(i) = entry;
}
- in_device.import(in, VectorOperation::insert);
+ in_device.import_elements(in, VectorOperation::insert);
mf.vmult(out_device, in_device);
cudaDeviceSynchronize();
- out.import(out_device, VectorOperation::insert);
+ out.import_elements(out_device, VectorOperation::insert);
// assemble sparse matrix with (\nabla v, \nabla u) + (v, 10 * u)
SparsityPattern sparsity;
LinearAlgebra::ReadWriteVector<Number> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<Number>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
const Number tolerance = 1000. * std::numeric_limits<Number>::epsilon();
SolverControl control(100, tolerance);
SolverCG<LinearAlgebra::CUDAWrappers::Vector<Number>> cg_dev(control);
LinearAlgebra::ReadWriteVector<Number> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<Number>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
const Number tolerance = 1000. * std::numeric_limits<Number>::epsilon();
SolverControl control(100, tolerance);
SolverCG<LinearAlgebra::CUDAWrappers::Vector<Number>> cg_dev(control);
continue;
rw_in.local_element(i) = random_value<double>();
}
- in_dev.import(rw_in, VectorOperation::insert);
+ in_dev.import_elements(rw_in, VectorOperation::insert);
// assemble trilinos sparse matrix with
// (\nabla v, \nabla u) + (v, 10 * u) for
// reference
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> in_host(
owned_set, MPI_COMM_WORLD);
- in_host.import(rw_in, VectorOperation::insert);
+ in_host.import_elements(rw_in, VectorOperation::insert);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> ref(
owned_set, MPI_COMM_WORLD);
TrilinosWrappers::SparseMatrix sparse_matrix;
LinearAlgebra::distributed::Vector<Number, MemorySpace::CUDA>>>(
LinearAlgebra::distributed::Vector<Number, MemorySpace::CUDA>(
ref.get_partitioner()));
- device_preconditioner_data.preconditioner->get_vector().import(
+ device_preconditioner_data.preconditioner->get_vector().import_elements(
matrix_diagonal, VectorOperation::insert);
device_preconditioner_data.constraints.copy_from(constraints);
precondition_chebyshev_device.initialize(mf, device_preconditioner_data);
LinearAlgebra::distributed::Vector<Number, MemorySpace::Host> out_host(
owned_set, MPI_COMM_WORLD);
LinearAlgebra::ReadWriteVector<Number> rw_out(owned_set);
- rw_out.import(out_dev, VectorOperation::insert);
- out_host.import(rw_out, VectorOperation::insert);
+ rw_out.import_elements(out_dev, VectorOperation::insert);
+ out_host.import_elements(rw_out, VectorOperation::insert);
precondition_chebyshev_host.vmult(ref, in_host);
out_host -= ref;
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverCG<LinearAlgebra::CUDAWrappers::Vector<double>> cg_dev(control);
cg_dev.solve(A_dev, sol_dev, rhs_dev, prec_no);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::CUDAWrappers::Vector<double> rhs_dev(size);
LinearAlgebra::ReadWriteVector<double> rhs_host(size);
std::copy(rhs.begin(), rhs.end(), rhs_host.begin());
- rhs_dev.import(rhs_host, VectorOperation::insert);
+ rhs_dev.import_elements(rhs_host, VectorOperation::insert);
LinearAlgebra::CUDAWrappers::Vector<double> solution_dev(size);
const std::array<std::string, 3> solver_names{
// Move the result back to the host
LinearAlgebra::ReadWriteVector<double> solution_host(size);
- solution_host.import(solution_dev, VectorOperation::insert);
+ solution_host.import_elements(solution_dev, VectorOperation::insert);
// Check the result
for (unsigned int i = 0; i < size; ++i)
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverGMRES<LinearAlgebra::CUDAWrappers::Vector<double>> cg_dev(control);
cg_dev.solve(A_dev, sol_dev, rhs_dev, prec_no);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverBicgstab<LinearAlgebra::CUDAWrappers::Vector<double>> bicgstab_dev(
control);
bicgstab_dev.solve(A_dev, sol_dev, rhs_dev, prec_no);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverFGMRES<LinearAlgebra::CUDAWrappers::Vector<double>> fgmres_dev(control);
fgmres_dev.solve(A_dev, sol_dev, rhs_dev, prec_no);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverFIRE<LinearAlgebra::CUDAWrappers::Vector<double>> fire_dev(control);
fire_dev.solve(A_dev, sol_dev, rhs_dev, prec_no);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverMinRes<LinearAlgebra::CUDAWrappers::Vector<double>> minres_dev(control);
minres_dev.solve(A_dev, sol_dev, rhs_dev, prec_no);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverQMRS<LinearAlgebra::CUDAWrappers::Vector<double>> qmrs_dev(control);
qmrs_dev.solve(A_dev, sol_dev, rhs_dev, prec_no);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverRichardson<LinearAlgebra::CUDAWrappers::Vector<double>> richardson_dev(
control);
richardson_dev.solve(A_dev, sol_dev, rhs_dev, preconditioner_dev);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> rw_vector(size);
for (unsigned int i = 0; i < size; ++i)
rw_vector[i] = static_cast<double>(i);
- rhs_dev.import(rw_vector, VectorOperation::insert);
+ rhs_dev.import_elements(rw_vector, VectorOperation::insert);
SolverRelaxation<LinearAlgebra::CUDAWrappers::Vector<double>> relaxation_dev(
control);
relaxation_dev.solve(A_dev, sol_dev, rhs_dev, relaxation_operator_dev);
// Check the result
- rw_vector.import(sol_dev, VectorOperation::insert);
+ rw_vector.import_elements(sol_dev, VectorOperation::insert);
for (unsigned int i = 0; i < size; ++i)
AssertThrow(std::fabs(rw_vector[i] - sol_host[i]) < 1e-8,
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> read_write(vector_size);
for (unsigned int i = 0; i < vector_size; ++i)
read_write[i] = i;
- src_dev.import(read_write, VectorOperation::insert);
+ src_dev.import_elements(read_write, VectorOperation::insert);
A_dev.vmult(dst_dev, src_dev);
- read_write.import(dst_dev, VectorOperation::insert);
+ read_write.import_elements(dst_dev, VectorOperation::insert);
check_vector(dst, read_write);
// Transpose matrix-vector multiplication
A.Tvmult(dst, src);
A_dev.Tvmult(dst_dev, src_dev);
- read_write.import(dst_dev, VectorOperation::insert);
+ read_write.import_elements(dst_dev, VectorOperation::insert);
check_vector(dst, read_write);
// Matrix-vector multiplication and add
A.vmult_add(dst, src);
A_dev.vmult_add(dst_dev, src_dev);
- read_write.import(dst_dev, VectorOperation::insert);
+ read_write.import_elements(dst_dev, VectorOperation::insert);
check_vector(dst, read_write);
// Transpose matrix-vector multiplication and add
A.Tvmult_add(dst, src);
A_dev.Tvmult_add(dst_dev, src_dev);
- read_write.import(dst_dev, VectorOperation::insert);
+ read_write.import_elements(dst_dev, VectorOperation::insert);
check_vector(dst, read_write);
// Matrix norm square
read_write[i] = i;
}
LinearAlgebra::CUDAWrappers::Vector<double> b_dev(vector_size);
- b_dev.import(read_write, VectorOperation::insert);
- src_dev.import(read_write, VectorOperation::insert);
+ b_dev.import_elements(read_write, VectorOperation::insert);
+ src_dev.import_elements(read_write, VectorOperation::insert);
value = A.residual(dst, src, b);
value_host = A_dev.residual(dst_dev, src_dev, b_dev);
AssertThrow(std::abs(value - value_host) < 1e-15, ExcInternalError());
- read_write.import(dst_dev, VectorOperation::insert);
+ read_write.import_elements(dst_dev, VectorOperation::insert);
check_vector(dst, read_write);
// Compute L1 norm
LinearAlgebra::ReadWriteVector<double> rw_vector(local_owned);
rw_vector(myid * 2) = myid * 2.0;
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
v *= 2.0;
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
if (myid == 0)
{
deallog << myid * 2 << ":" << rw_vector(myid * 2) << std::endl;
LinearAlgebra::ReadWriteVector<double> rw_vector(local_owned);
rw_vector(myid * 2) = myid * 2.0;
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
- v.import(rw_vector, VectorOperation::add);
+ v.import_elements(rw_vector, VectorOperation::add);
v *= 2.0;
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
AssertThrow(rw_vector(myid * 2) == myid * 4.0, ExcInternalError());
AssertThrow(rw_vector(myid * 2 + 1) == myid * 4.0 + 2.0, ExcInternalError());
// set ghost dof, compress
LinearAlgebra::ReadWriteVector<double> rw_relevant_vector(numproc * 2);
rw_relevant_vector(1) = 7;
- v.import(rw_relevant_vector, VectorOperation::add);
+ v.import_elements(rw_relevant_vector, VectorOperation::add);
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
if (myid == 0)
{
deallog << myid * 2 << ":" << rw_vector(myid * 2) << std::endl;
deallog << myid * 2 + 1 << ":" << rw_vector(myid * 2 + 1) << std::endl;
}
- rw_relevant_vector.import(v, VectorOperation::insert);
+ rw_relevant_vector.import_elements(v, VectorOperation::insert);
AssertThrow(rw_relevant_vector(1) == 7. * numproc + 2, ExcInternalError());
// check l2 norm
LinearAlgebra::ReadWriteVector<double> rw_vector(local_owned);
rw_vector(myid * 2) = myid * 2.0;
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
v *= 2.0;
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
AssertThrow(rw_vector(myid * 2) == myid * 4.0, ExcInternalError());
AssertThrow(rw_vector(myid * 2 + 1) == myid * 4.0 + 2.0, ExcInternalError());
ghost_entry.add_index(1);
LinearAlgebra::ReadWriteVector<double> rw_ghost_entry(ghost_entry);
rw_ghost_entry(1) = 7.;
- v.import(rw_ghost_entry, VectorOperation::insert);
+ v.import_elements(rw_ghost_entry, VectorOperation::insert);
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
if (myid == 0)
{
deallog << myid * 2 << ":" << rw_vector(myid * 2) << std::endl;
// import ghosts onto all procs
v.update_ghost_values();
rw_ghost_entry(1) = 0.;
- rw_ghost_entry.import(v, VectorOperation::insert);
+ rw_ghost_entry.import_elements(v, VectorOperation::insert);
AssertThrow(rw_ghost_entry(1) == 7.0, ExcInternalError());
// check l2 norm
// set value from processor which does not own it:
rw_vector(5) = 55.;
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
// add to value from processor which has it as a ghost
// Because of limitation in import, the ReadWriteVector needs to have locally
{
rw_add.reinit(indexset_2);
}
- v.import(rw_add, VectorOperation::add); // 60 + 6
+ v.import_elements(rw_add, VectorOperation::add); // 60 + 6
// compress(insert) used to leave ghosts un-touched which resulted in
// the wrong 55+55 for this compress(add) operation.
}
rw_vector.reinit(indexset_3);
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
check(myid, rw_vector);
rw_vector(myid * 2) = myid * 2.0;
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
v *= 2.0;
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
AssertThrow(rw_vector(myid * 2) == myid * 4.0, ExcInternalError());
AssertThrow(rw_vector(myid * 2 + 1) == myid * 4.0 + 2.0, ExcInternalError());
rw_vector(myid * 2) = myid * 2.0;
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
v *= 2.0;
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
Assert(rw_vector(myid * 2) == myid * 4.0, ExcInternalError());
Assert(rw_vector(myid * 2 + 1) == myid * 4.0 + 2.0, ExcInternalError());
ghost_vector.reinit(ghost_set);
- v.import(ghost_vector, VectorOperation::add);
+ v.import_elements(ghost_vector, VectorOperation::add);
// check that nothing has changed
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
Assert(rw_vector(myid * 2) == myid * 4.0, ExcInternalError());
Assert(rw_vector(myid * 2 + 1) == myid * 4.0 + 2.0, ExcInternalError());
rw_vector(myid * 2) = myid * 2.0;
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
}
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
v *= 2.0;
{
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
AssertThrow(rw_vector(myid * 2) == myid * 4.0, ExcInternalError());
AssertThrow(rw_vector(myid * 2 + 1) == myid * 4.0 + 2.0,
ExcInternalError());
if (myid == 0)
deallog << " v2==0 ? " << allzero << std::endl;
- v2.import(rw_vector, VectorOperation::insert);
+ v2.import_elements(rw_vector, VectorOperation::insert);
allzero = v2.all_zero();
if (myid == 0)
deallog << " v2==0 ? " << allzero << std::endl;
LinearAlgebra::ReadWriteVector<double> rw_vector(local_owned);
for (unsigned i = 0; i < local_size; ++i)
rw_vector.local_element(i) = 2.0 * (i + my_start);
- w.import(rw_vector, VectorOperation::insert);
+ w.import_elements(rw_vector, VectorOperation::insert);
v = w;
v.update_ghost_values();
v_move = std::move(v_copy);
LinearAlgebra::ReadWriteVector<double> v_rw(local_relevant);
- v_rw.import(v, VectorOperation::insert);
+ v_rw.import_elements(v, VectorOperation::insert);
LinearAlgebra::ReadWriteVector<double> v_move_rw(local_relevant);
- v_move_rw.import(v_move, VectorOperation::insert);
+ v_move_rw.import_elements(v_move, VectorOperation::insert);
for (unsigned int i = 0; i < v_rw.locally_owned_size(); ++i)
AssertThrow(v_move_rw.local_element(i) == v_rw.local_element(i),
}
// check local values for correctness
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
for (unsigned int i = 0; i < local_size; ++i)
AssertThrow(rw_vector.local_element(i) == 2.0 * (i + my_start),
ExcInternalError());
// check non-local entries on all processors
LinearAlgebra::ReadWriteVector<double> ghost_vector(local_relevant);
- ghost_vector.import(v, VectorOperation::insert);
+ ghost_vector.import_elements(v, VectorOperation::insert);
for (unsigned int i = 0; i < 10; ++i)
AssertThrow(ghost_vector(ghost_indices[i]) == 2. * ghost_indices[i],
ExcInternalError());
v = w;
// check local values for correctness
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
for (unsigned int i = 0; i < local_size; ++i)
AssertThrow(rw_vector.local_element(i) == 2.0 * (i + my_start),
ExcInternalError());
// check non-local entries on all processors
- ghost_vector.import(v, VectorOperation::insert);
+ ghost_vector.import_elements(v, VectorOperation::insert);
for (unsigned int i = 0; i < 10; ++i)
AssertThrow(ghost_vector(ghost_indices[i]) == 2. * ghost_indices[i],
ExcInternalError());
LinearAlgebra::ReadWriteVector<double> rw_vector(local_owned);
rw_vector(myid * 2) = myid * 2.0;
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
v.update_ghost_values();
IndexSet ghost_set(numproc * 2);
ghost_set.add_index(1);
LinearAlgebra::ReadWriteVector<double> ghost_vector(ghost_set);
- ghost_vector.import(v, VectorOperation::insert);
+ ghost_vector.import_elements(v, VectorOperation::insert);
AssertThrow(ghost_vector(1) == 1., ExcInternalError());
// copy vector
v.update_ghost_values();
w.update_ghost_values();
- ghost_vector.import(v, VectorOperation::insert);
+ ghost_vector.import_elements(v, VectorOperation::insert);
AssertThrow(ghost_vector(1) == 2., ExcInternalError());
- ghost_vector.import(w, VectorOperation::insert);
+ ghost_vector.import_elements(w, VectorOperation::insert);
AssertThrow(ghost_vector(1) == 1., ExcInternalError());
if (myid == 0)
w_rw.local_element(i) = 1000 + 2 * (my_start + i);
x_rw.local_element(i) = 10000;
}
- v.import(v_rw, VectorOperation::insert);
- w.import(w_rw, VectorOperation::insert);
- x.import(x_rw, VectorOperation::insert);
+ v.import_elements(v_rw, VectorOperation::insert);
+ w.import_elements(w_rw, VectorOperation::insert);
+ x.import_elements(x_rw, VectorOperation::insert);
y = v;
LinearAlgebra::ReadWriteVector<double> y_rw(local_owned);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == i + my_start, ExcInternalError());
if (myid == 0)
deallog << "Check add (scalar): ";
y.add(42);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == i + my_start + 42, ExcInternalError());
if (myid == 0)
if (myid == 0)
deallog << "Check add (vector): ";
y.add(1., w);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == 3 * (i + my_start) + 1042,
ExcInternalError());
if (myid == 0)
deallog << "Check add (factor, vector): ";
y.add(-1., w);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == i + my_start + 42, ExcInternalError());
if (myid == 0)
if (myid == 0)
deallog << "Check add (factor, vector, factor, vector): ";
y.add(2., w, -0.5, x);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == 5 * (i + my_start) + 2042 - 5000,
ExcInternalError());
deallog << "Check sadd (factor, factor, vector): ";
y = v;
y.sadd(-3., 2., v);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == (-i - my_start), ExcInternalError());
if (myid == 0)
deallog << "Check sadd (factor, factor, vector, factor, vector): ";
y.sadd(2., 3., v);
y.add(2., w);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
{
AssertThrow(y_rw.local_element(i) == 5 * (i + my_start) + 2000,
y.sadd(-1., 1., v);
y.add(2., w);
y.add(2., x);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == 20000, ExcInternalError());
if (myid == 0)
deallog << "Check add (factor, vector_1, factor, vector_1): ";
y = 0;
y.add(1., v, 3., v);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == 4 * (i + my_start),
ExcInternalError());
if (myid == 0)
deallog << "Check operator * (scalar): ";
x *= 2.;
- x_rw.import(x, VectorOperation::insert);
+ x_rw.import_elements(x, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(x_rw.local_element(i) == 20000., ExcInternalError());
if (myid == 0)
if (myid == 0)
deallog << "Check operator / (scalar): ";
x /= 2.;
- x_rw.import(x, VectorOperation::insert);
+ x_rw.import_elements(x, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(x_rw.local_element(i) == 10000., ExcInternalError());
if (myid == 0)
if (myid == 0)
deallog << "Check scale (vector): ";
y.scale(x);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == 40000. * (i + my_start),
ExcInternalError());
if (myid == 0)
deallog << "Check equ (factor, vector): ";
y.equ(10., x);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == 100000., ExcInternalError());
if (myid == 0)
deallog << "Check equ (factor, vector, factor, vector): ";
y.equ(10., v);
y.add(-2., w);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == 6. * (i + my_start) - 2000,
ExcInternalError());
y.equ(10., v);
y.add(-2., w);
y.add(3., x);
- y_rw.import(y, VectorOperation::insert);
+ y_rw.import_elements(y, VectorOperation::insert);
for (int i = 0; i < actual_local_size; ++i)
AssertThrow(y_rw.local_element(i) == 6. * (i + my_start) + 28000,
ExcInternalError());
v1 = 2;
// check assignment in initial state
LinearAlgebra::ReadWriteVector<double> v0_rw(local_owned0);
- v0_rw.import(v0, VectorOperation::insert);
+ v0_rw.import_elements(v0, VectorOperation::insert);
LinearAlgebra::ReadWriteVector<double> v1_rw(local_owned1);
- v1_rw.import(v1, VectorOperation::insert);
+ v1_rw.import_elements(v1, VectorOperation::insert);
for (unsigned int i = 0; i < v0.local_size(); ++i)
AssertThrow(v0_rw.local_element(i) == 1.,
ExcNonEqual(v0_rw.local_element(i), 1.));
v0.update_ghost_values();
v1.update_ghost_values();
LinearAlgebra::ReadWriteVector<double> v0_ghost_rw(local_relevant0);
- v0_ghost_rw.import(v0, VectorOperation::insert);
+ v0_ghost_rw.import_elements(v0, VectorOperation::insert);
LinearAlgebra::ReadWriteVector<double> v1_ghost_rw(local_relevant1);
- v1_ghost_rw.import(v1, VectorOperation::insert);
+ v1_ghost_rw.import_elements(v1, VectorOperation::insert);
AssertThrow(v0_ghost_rw(2) == 1., ExcNonEqual(v0_ghost_rw(2), 1.));
if (numproc > 2)
AssertThrow(v0_ghost_rw(8) == 1., ExcNonEqual(v0_ghost_rw(8), 2.));
AssertDimension(v1.local_size(), actual_local_size0);
AssertDimension(v0.size(), global_size1);
AssertDimension(v1.size(), global_size0);
- v1_rw.import(v0, VectorOperation::insert);
+ v1_rw.import_elements(v0, VectorOperation::insert);
for (unsigned int i = 0; i < local_size1; ++i)
AssertThrow(v1_rw.local_element(i) == 2.,
ExcNonEqual(v1_rw.local_element(i), 2.));
- v0_rw.import(v1, VectorOperation::insert);
+ v0_rw.import_elements(v1, VectorOperation::insert);
for (unsigned int i = 0; i < actual_local_size0; ++i)
AssertThrow(v0_rw.local_element(i) == 1.,
ExcNonEqual(v0_rw.local_element(i), 1.));
deallog << "First swap OK" << std::endl;
v0.update_ghost_values();
v1.update_ghost_values();
- v0_ghost_rw.import(v1, VectorOperation::insert);
+ v0_ghost_rw.import_elements(v1, VectorOperation::insert);
AssertThrow(v0_ghost_rw(2) == 1., ExcNonEqual(v0_ghost_rw(2), 1.));
if (numproc > 2)
AssertThrow(v0_ghost_rw(8) == 1., ExcNonEqual(v0_ghost_rw(8), 1.));
- v1_ghost_rw.import(v0, VectorOperation::insert);
+ v1_ghost_rw.import_elements(v0, VectorOperation::insert);
AssertThrow(v1_ghost_rw(0) == 2., ExcNonEqual(v1_ghost_rw(0), 2.));
AssertThrow(v1_ghost_rw(2) == 2., ExcNonEqual(v1_ghost_rw(2), 2.));
if (numproc > 2)
v1 = 42.;
v0.update_ghost_values();
v1.update_ghost_values();
- v0_ghost_rw.import(v1, VectorOperation::insert);
+ v0_ghost_rw.import_elements(v1, VectorOperation::insert);
AssertThrow(v0_ghost_rw(2) == 42., ExcNonEqual(v0_ghost_rw(2), 42.));
if (numproc > 2)
AssertThrow(v0_ghost_rw(8) == 42., ExcNonEqual(v0_ghost_rw(8), 42.));
- v1_ghost_rw.import(v0, VectorOperation::insert);
+ v1_ghost_rw.import_elements(v0, VectorOperation::insert);
AssertThrow(v1_ghost_rw(0) == 7., ExcNonEqual(v1_ghost_rw(0), 7.));
AssertThrow(v1_ghost_rw(2) == 7., ExcNonEqual(v1_ghost_rw(2), 7.));
if (numproc > 2)
AssertDimension(v0.size(), 0);
AssertDimension(v2.size(), global_size1);
AssertDimension(v2.local_size(), local_size1);
- v1_rw.import(v2, VectorOperation::insert);
+ v1_rw.import_elements(v2, VectorOperation::insert);
for (int i = my_start1; i < my_end1; ++i)
AssertThrow(v1_rw(i) == 7., ExcNonEqual(v1_rw(i), 7.));
MPI_Barrier(MPI_COMM_WORLD);
deallog << "Second swap OK" << std::endl;
v2 = -1.;
v2.update_ghost_values();
- v1_ghost_rw.import(v2, VectorOperation::insert);
+ v1_ghost_rw.import_elements(v2, VectorOperation::insert);
AssertThrow(v1_ghost_rw(0) == -1., ExcNonEqual(v1_ghost_rw(0), -1.));
AssertThrow(v1_ghost_rw(2) == -1., ExcNonEqual(v1_ghost_rw(2), -1.));
if (numproc > 2)
rw_vector(myid * 2) = myid * 2.0;
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
v *= 2.0;
v.add(1.0);
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
AssertThrow(rw_vector(myid * 2) == myid * 4.0 + 1, ExcInternalError());
AssertThrow(rw_vector(myid * 2 + 1) == myid * 4.0 + 3.0, ExcInternalError());
index.add_index(1);
LinearAlgebra::ReadWriteVector<double> local_rw_vector(index);
local_rw_vector(1) = 7;
- v.import(local_rw_vector, VectorOperation::insert);
+ v.import_elements(local_rw_vector, VectorOperation::insert);
{
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
deallog << myid * 2 << ":" << rw_vector(myid * 2) << std::endl;
deallog << myid * 2 + 1 << ":" << rw_vector(myid * 2 + 1) << std::endl;
}
local_rw_vector(1) = -7;
- v.import(local_rw_vector, VectorOperation::insert);
+ v.import_elements(local_rw_vector, VectorOperation::insert);
{
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
deallog << myid * 2 << ":" << rw_vector(myid * 2) << std::endl;
deallog << myid * 2 + 1 << ":" << rw_vector(myid * 2 + 1) << std::endl;
}
// import ghosts onto all procs
v.update_ghost_values();
- local_rw_vector.import(v, VectorOperation::insert);
+ local_rw_vector.import_elements(v, VectorOperation::insert);
AssertThrow(local_rw_vector(1) == -7.0, ExcInternalError());
// check l2 norm
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
}
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
LinearAlgebra::distributed::Vector<double, MemorySpace::Default> w(v),
u(v);
u.update_ghost_values();
}
- rw_vector.import(v, VectorOperation::insert);
+ rw_vector.import_elements(v, VectorOperation::insert);
if (myid < 2)
{
Assert(rw_vector(myid * 2) == myid * 4.0 + 1, ExcInternalError());
u = u_dist;
u.update_ghost_values();
- rw_vector.import(u_dist, VectorOperation::insert);
+ rw_vector.import_elements(u_dist, VectorOperation::insert);
if (myid < 2)
{
Assert(rw_vector(myid * 2) == myid * 2.0 + 1, ExcInternalError());
ExcInternalError());
}
- rw_vector.import(u, VectorOperation::insert);
+ rw_vector.import_elements(u, VectorOperation::insert);
if (myid < 2)
{
Assert(rw_vector(myid * 2) == myid * 2.0 + 1, ExcInternalError());
u_ghost_set.add_index(1);
u_ghost_set.add_index(3);
LinearAlgebra::ReadWriteVector<double> u_ghost_vector(u_ghost_set);
- u_ghost_vector.import(u, VectorOperation::insert);
+ u_ghost_vector.import_elements(u, VectorOperation::insert);
Assert(u_ghost_vector(1) == 2., ExcInternalError());
if (numproc > 1)
{
v_ghost_set.add_index(3);
LinearAlgebra::ReadWriteVector<double> v_ghost_vector(
v_ghost_set);
- v_ghost_vector.import(v, VectorOperation::insert);
+ v_ghost_vector.import_elements(v, VectorOperation::insert);
Assert(v_ghost_vector(3) == 7., ExcInternalError());
}
Assert(u_ghost_vector(3) == 4., ExcInternalError());
rw_vector(myid * 2 + 1) = myid * 2.0 + 1.0;
}
- v.import(rw_vector, VectorOperation::insert);
+ v.import_elements(rw_vector, VectorOperation::insert);
if (myid == 0)
deallog << "v has ghost elements: " << v.has_ghost_elements() << std::endl;
LinearAlgebra::ReadWriteVector<double> rw_vector(workaround_set);
rw_vector(0) += 1.;
rw_vector(2) += 1.;
- v2.import(rw_vector, VectorOperation::add);
+ v2.import_elements(rw_vector, VectorOperation::add);
// now we should have the correct data, not some uninitialized trash that
// resided in the ghost range
read_write_vector.local_element(0) = myid;
read_write_vector(1) = 2. * myid;
- v.import(read_write_vector, VectorOperation::max);
+ v.import_elements(read_write_vector, VectorOperation::max);
v.update_ghost_values();
deallog << myid << ":"
if (myid == 0)
read_write_vector(1) = -1.0;
- v.import(read_write_vector, VectorOperation::min);
+ v.import_elements(read_write_vector, VectorOperation::min);
v.update_ghost_values();
deallog << myid << ":"
partitioner);
// Assignment from Host to Default
- vec_dev.import(vec_ref, VectorOperation::insert);
+ vec_dev.import_elements(vec_ref, VectorOperation::insert);
// Assignment from Default to Host
- vec_host.import(vec_dev, VectorOperation::insert);
+ vec_host.import_elements(vec_dev, VectorOperation::insert);
for (unsigned int i = 0; i < ghost_size; ++i)
{
read_write_vector.local_element(0) = 1.;
read_write_vector.local_element(1) = 2.;
- v.import(read_write_vector, VectorOperation::insert);
+ v.import_elements(read_write_vector, VectorOperation::insert);
AssertThrow(v.local_element(0) == 1., ExcInternalError());
AssertThrow(v.local_element(1) == 2., ExcInternalError());
read_write_vector.local_element(0) = 1.;
read_write_vector.local_element(1) = 2.;
- v.import(read_write_vector, VectorOperation::insert);
+ v.import_elements(read_write_vector, VectorOperation::insert);
AssertThrow(v.local_element(0) == my_id + 1, ExcInternalError());
AssertThrow(v.local_element(1) == my_id + 1, ExcInternalError());
read_write_vector.local_element(0) = myid;
read_write_vector(1) = 2. * myid;
- v.import(read_write_vector, VectorOperation::max);
+ v.import_elements(read_write_vector, VectorOperation::max);
v.update_ghost_values();
deallog << myid << ':' << "ghost entry after max: " << v(1) << std::endl;
if (!myid)
read_write_vector(1) = -1.0;
- v.import(read_write_vector, VectorOperation::min);
+ v.import_elements(read_write_vector, VectorOperation::min);
v.update_ghost_values();
deallog << myid << ':' << "ghost entry after min: " << v(1) << std::endl;
{
rw_vector.reinit(ghost_set);
}
- v.import(rw_vector, VectorOperation::add); // 60 + 6
+ v.import_elements(rw_vector, VectorOperation::add); // 60 + 6
// compress(insert) used to leave ghosts un-touched which resulted in
// the wrong 55+55 for this compress(add) operation.
}
}
- a.import(read_write_2, VectorOperation::insert);
- b.import(read_write_1, VectorOperation::insert);
- c.import(read_write_2, VectorOperation::insert);
+ a.import_elements(read_write_2, VectorOperation::insert);
+ b.import_elements(read_write_1, VectorOperation::insert);
+ c.import_elements(read_write_2, VectorOperation::insert);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
ExcMessage("Vector a has been modified."));
}
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
ExcMessage("Vector b has been modified."));
}
- read_write_3.import(c, VectorOperation::insert);
+ read_write_3.import_elements(c, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
a *= 2;
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
c /= 2.;
- read_write_3.import(c, VectorOperation::insert);
+ read_write_3.import_elements(c, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
b += a;
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
b -= c;
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
ExcMessage("Problem in operator -=."));
}
- b.import(read_write_1, VectorOperation::insert);
- c.import(read_write_1, VectorOperation::insert);
+ b.import_elements(read_write_1, VectorOperation::insert);
+ c.import_elements(read_write_1, VectorOperation::insert);
const double val = b * c;
AssertThrow(val == 285., ExcMessage("Problem in operator *."));
}
}
}
- a.import(read_write_1, VectorOperation::insert);
- b.import(read_write_2, VectorOperation::insert);
- c.import(read_write_2, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
+ b.import_elements(read_write_2, VectorOperation::insert);
+ c.import_elements(read_write_2, VectorOperation::insert);
a.add(1.);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
a.add(2., b);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
LinearAlgebra::EpetraWrappers::Vector d(a);
a.add(2., b, 3., d);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
a.sadd(3., 2., c);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
a.scale(b);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
a.equ(2., c);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
AssertThrow(b.linfty_norm() == 14., ExcMessage("Problem in linfty_norm."));
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
const double val = a.add_and_dot(2., a, b);
AssertThrow(val == 1530., ExcMessage("Problem in add_and_dot"));
}
LinearAlgebra::ReadWriteVector<double> read_write(parallel_partitioner);
if (rank == 0)
read_write[0] = 1.;
- a.import(read_write, VectorOperation::insert);
+ a.import_elements(read_write, VectorOperation::insert);
AssertThrow(a.all_zero() == false, ExcInternalError());
}
readwrite_is.add_range(2, 6);
readwrite_is.compress();
LinearAlgebra::ReadWriteVector<double> readwrite(readwrite_is);
- readwrite.import(tril_vector, VectorOperation::insert);
+ readwrite.import_elements(tril_vector, VectorOperation::insert);
if (rank == 0)
{
std::vector<double> comp(4);
ExcMessage("Element not copied correctly"));
}
- readwrite.import(tril_vector, VectorOperation::add);
+ readwrite.import_elements(tril_vector, VectorOperation::add);
if (rank == 0)
{
LinearAlgebra::ReadWriteVector<double> readwrite(readwrite_is);
try
{
- readwrite.import(tril_vector_ghosted, VectorOperation::insert);
+ readwrite.import_elements(tril_vector_ghosted, VectorOperation::insert);
deallog << "RWVector contents:" << std::endl;
readwrite.print(deallog.get_file_stream());
}
{
deallog << "import of distributed vector should work:" << std::endl;
LinearAlgebra::ReadWriteVector<double> readwrite(readwrite_is);
- readwrite.import(tril_vector, VectorOperation::insert);
+ readwrite.import_elements(tril_vector, VectorOperation::insert);
deallog << "RWVector contents:" << std::endl;
readwrite.print(deallog.get_file_stream());
}
//
// ---------------------------------------------------------------------
-// test: RWV::import() from TrilinosWrappers::MPI::Vector
+// test: RWV::import_elements() from TrilinosWrappers::MPI::Vector
#include <deal.II/base/index_set.h>
#include <deal.II/base/utilities.h>
readwrite.print(deallog.get_file_stream());
// import RWV->Trilinos
- tril_vector.import(readwrite, VectorOperation::insert);
+ tril_vector.import_elements(readwrite, VectorOperation::insert);
deallog << "trilinos vec:" << std::endl;
tril_vector.print(deallog.get_file_stream());
// test that ::add also works
- tril_vector.import(readwrite, VectorOperation::add);
+ tril_vector.import_elements(readwrite, VectorOperation::add);
deallog << "trilinos vec (2x):" << std::endl;
tril_vector.print(deallog.get_file_stream());
// import again overwriting the contents
- tril_vector.import(readwrite, VectorOperation::insert);
+ tril_vector.import_elements(readwrite, VectorOperation::insert);
deallog << "trilinos vec (1x):" << std::endl;
tril_vector.print(deallog.get_file_stream());
read_write_v(i) = i;
m.compress(VectorOperation::insert);
- v.import(read_write_v, VectorOperation::insert);
+ v.import_elements(read_write_v, VectorOperation::insert);
// w:=Mv
m.vmult(w, v);
// make sure we get the expected result
- read_write_w.import(w, VectorOperation::insert);
+ read_write_w.import_elements(w, VectorOperation::insert);
for (unsigned int i = 0; i < m.m(); ++i)
{
double result = 0;
m.vmult_add(w, v);
// make sure we get the expected result
- read_write_w.import(w, VectorOperation::insert);
+ read_write_w.import_elements(w, VectorOperation::insert);
for (unsigned int i = 0; i < m.m(); ++i)
{
double result = 0;
read_write_v(i) = i;
m.compress(VectorOperation::insert);
- v.import(read_write_v, VectorOperation::insert);
+ v.import_elements(read_write_v, VectorOperation::insert);
// w:=Mv
m.Tvmult(w, v);
// make sure we get the expected result
- read_write_w.import(w, VectorOperation::insert);
+ read_write_w.import_elements(w, VectorOperation::insert);
for (unsigned int i = 0; i < m.n(); ++i)
{
double result = 0;
m.Tvmult_add(w, v);
// make sure we get the expected result
- read_write_w.import(w, VectorOperation::insert);
+ read_write_w.import_elements(w, VectorOperation::insert);
for (unsigned int i = 0; i < m.n(); ++i)
{
double result = 0;
read_write_v(i) = i;
m.compress(VectorOperation::insert);
- v.import(read_write_v, VectorOperation::insert);
+ v.import_elements(read_write_v, VectorOperation::insert);
// w:=Mv
m.vmult(w, v);
// make sure we get the expected result
- read_write_w.import(w, VectorOperation::insert);
+ read_write_w.import_elements(w, VectorOperation::insert);
for (unsigned int i = 0; i < m.m(); ++i)
{
double result = 0;
m.vmult_add(w, v);
// make sure we get the expected result
- read_write_w.import(w, VectorOperation::insert);
+ read_write_w.import_elements(w, VectorOperation::insert);
for (unsigned int i = 0; i < m.m(); ++i)
{
double result = 0;
read_write_v(i) = i;
m.compress(VectorOperation::insert);
- v.import(read_write_v, VectorOperation::insert);
+ v.import_elements(read_write_v, VectorOperation::insert);
// w:=Mv
m.Tvmult(w, v);
// make sure we get the expected result
- read_write_w.import(w, VectorOperation::insert);
+ read_write_w.import_elements(w, VectorOperation::insert);
for (unsigned int i = 0; i < m.n(); ++i)
{
double result = 0;
m.Tvmult_add(w, v);
// make sure we get the expected result
- read_write_w.import(w, VectorOperation::insert);
+ read_write_w.import_elements(w, VectorOperation::insert);
for (unsigned int i = 0; i < m.n(); ++i)
{
double result = 0;
LinearAlgebra::ReadWriteVector<double> v_tmp(local_range);
LinearAlgebra::EpetraWrappers::Vector v2(local_range, MPI_COMM_WORLD);
- v_tmp.import(v1, VectorOperation::insert);
- v2.import(v_tmp, VectorOperation::insert);
+ v_tmp.import_elements(v1, VectorOperation::insert);
+ v2.import_elements(v_tmp, VectorOperation::insert);
VectorTools::subtract_mean_value(v2);
AssertThrow(std::fabs(v2.mean_value()) < 1e-10 * v2.l2_norm(),
ExcInternalError());
}
}
- a.import(read_write_2, VectorOperation::insert);
+ a.import_elements(read_write_2, VectorOperation::insert);
AssertThrow(a.size() == 10, ExcMessage("Vector has the wrong size."));
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
ExcMessage("Vector a has been modified."));
}
- b.import(read_write_1, VectorOperation::insert);
+ b.import_elements(read_write_1, VectorOperation::insert);
AssertThrow(b.size() == 10, ExcMessage("Vector has the wrong size."));
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
ExcMessage("Vector b has been modified."));
}
- c.import(read_write_2, VectorOperation::insert);
+ c.import_elements(read_write_2, VectorOperation::insert);
AssertThrow(c.size() == 10, ExcMessage("Vector has the wrong size."));
- read_write_3.import(c, VectorOperation::insert);
+ read_write_3.import_elements(c, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
}
a *= 2;
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
}
c /= 2.;
- read_write_3.import(c, VectorOperation::insert);
+ read_write_3.import_elements(c, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
}
b += a;
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
}
b -= c;
- read_write_3.import(b, VectorOperation::insert);
+ read_write_3.import_elements(b, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
ExcMessage("Problem in operator -=."));
}
- b.import(read_write_1, VectorOperation::insert);
- c.import(read_write_1, VectorOperation::insert);
+ b.import_elements(read_write_1, VectorOperation::insert);
+ c.import_elements(read_write_1, VectorOperation::insert);
const Number val = b * c;
AssertThrow(val == Number(285.), ExcMessage("Problem in operator *."));
}
}
}
- a.import(read_write_1, VectorOperation::insert);
- b.import(read_write_2, VectorOperation::insert);
- c.import(read_write_2, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
+ b.import_elements(read_write_2, VectorOperation::insert);
+ c.import_elements(read_write_2, VectorOperation::insert);
a.add(1.);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
a.add(2., b);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
LinearAlgebra::TpetraWrappers::Vector<Number> d(a);
a.add(2., b, 3., d);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
a.sadd(3., 2., c);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
}
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
a.scale(b);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
a.equ(2., c);
- read_write_3.import(a, VectorOperation::insert);
+ read_write_3.import_elements(a, VectorOperation::insert);
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
AssertThrow(b.linfty_norm() == 14., ExcMessage("Problem in linfty_norm."));
- a.import(read_write_1, VectorOperation::insert);
+ a.import_elements(read_write_1, VectorOperation::insert);
const Number val = a.add_and_dot(2., a, b);
AssertThrow(val == Number(1530.), ExcMessage("Problem in add_and_dot"));
}
rw_vector(my_second_index) = my_id + 100;
rw_vector(0) = 1.;
// rw_vector(2) = 1.;
- v.import(rw_vector, VectorOperation::add);
+ v.import_elements(rw_vector, VectorOperation::add);
deallog << "Tpetra first import add:" << std::endl;
v.print(deallog.get_file_stream());
rw_vector.print(deallog.get_file_stream());
rw_vector(my_second_index) = my_id + 200;
rw_vector(0) = 2.;
// rw_vector(2) = 3.;
- v.import(rw_vector, VectorOperation::add);
+ v.import_elements(rw_vector, VectorOperation::add);
deallog << "Tpetra second import add:" << std::endl;
v.print(deallog.get_file_stream());
rw_vector.print(deallog.get_file_stream());
- rw_vector.import(v, VectorOperation::add);
+ rw_vector.import_elements(v, VectorOperation::add);
deallog << "ReadWrite import add:" << std::endl;
rw_vector.print(deallog.get_file_stream());
rw_vector(my_second_index) = 1;
rw_vector(0) = 4.;
// rw_vector(2) = 3.;
- rw_vector.import(v, VectorOperation::min);
+ rw_vector.import_elements(v, VectorOperation::min);
deallog << "ReadWrite import min:" << std::endl;
rw_vector.print(deallog.get_file_stream());
rw_vector(my_second_index) = 1;
rw_vector(0) = 4.;
// rw_vector(2) = 3.;
- rw_vector.import(v, VectorOperation::max);
+ rw_vector.import_elements(v, VectorOperation::max);
deallog << "ReadWrite import max:" << std::endl;
rw_vector.print(deallog.get_file_stream());
}