*/
virtual void import(const ReadWriteVector<Number> &V,
VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern = NULL) override;
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern = nullptr) override;
/**
* Add @p a to all components. Note that @p a is a scalar not a vector.
template <typename Number>
void Vector<Number>::import(const ReadWriteVector<Number> &,
VectorOperation::values ,
- const CommunicationPatternBase *)
+ std::shared_ptr<const CommunicationPatternBase>)
{
AssertThrow(false, ExcMessage("This function is not implemented."));
}
*/
void import(const PETScWrappers::MPI::Vector &petsc_vec,
VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern = nullptr);
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern = nullptr);
#endif
#ifdef DEAL_II_WITH_TRILINOS
*/
void import(const TrilinosWrappers::MPI::Vector &trilinos_vec,
VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern = nullptr);
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern = nullptr);
/**
* Imports all the elements present in the vector's IndexSet from the input
*/
void import(const EpetraWrappers::Vector &epetra_vec,
VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern = nullptr);
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern = nullptr);
#endif
/**
* vector @p multivector. This is an helper function and it should not be
* used directly.
*/
- void import(const Epetra_MultiVector &multivector,
- const IndexSet &locally_owned_elements,
- VectorOperation::values operation,
- const MPI_Comm &mpi_comm,
- const CommunicationPatternBase *communication_pattern);
+ void import(const Epetra_MultiVector &multivector,
+ const IndexSet &locally_owned_elements,
+ VectorOperation::values operation,
+ const MPI_Comm &mpi_comm,
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern);
#endif
/**
const IndexSet &source_elements,
VectorOperation::values operation,
const MPI_Comm &mpi_comm,
- const CommunicationPatternBase *communication_pattern)
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern)
{
std_cxx11::shared_ptr<const EpetraWrappers::CommunicationPattern> epetra_comm_pattern;
}
else
{
- epetra_comm_pattern.reset(
- dynamic_cast<const EpetraWrappers::CommunicationPattern *> (communication_pattern));
+ epetra_comm_pattern = std::dynamic_pointer_cast<const EpetraWrappers::CommunicationPattern> (
+ communication_pattern);
AssertThrow(epetra_comm_pattern != nullptr,
ExcMessage(std::string("The communication pattern is not of type ") +
"LinearAlgebra::EpetraWrappers::CommunicationPattern."));
template <typename Number>
void
- ReadWriteVector<Number>::import(const TrilinosWrappers::MPI::Vector &trilinos_vec,
- VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern)
+ ReadWriteVector<Number>::import(const TrilinosWrappers::MPI::Vector &trilinos_vec,
+ VectorOperation::values operation,
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern)
{
import(trilinos_vec.trilinos_vector(), trilinos_vec.locally_owned_elements(),
operation, trilinos_vec.get_mpi_communicator(), communication_pattern);
template <typename Number>
void
- ReadWriteVector<Number>::import(const LinearAlgebra::EpetraWrappers::Vector &trilinos_vec,
- VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern)
+ ReadWriteVector<Number>::import(const LinearAlgebra::EpetraWrappers::Vector &trilinos_vec,
+ VectorOperation::values operation,
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern)
{
import(trilinos_vec.trilinos_vector(), trilinos_vec.locally_owned_elements(),
operation, trilinos_vec.get_mpi_communicator(), communication_pattern);
*/
virtual void import(const ReadWriteVector<double> &V,
VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern = NULL)
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern = nullptr)
override;
/**
*/
virtual void import(const ReadWriteVector<Number> &V,
VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern = NULL) = 0;
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern = nullptr) = 0;
/**
* Return the scalar product of two vectors.
- void Vector::import(const ReadWriteVector<double> &V,
- VectorOperation::values operation,
- const CommunicationPatternBase *communication_pattern)
+ void Vector::import(const ReadWriteVector<double> &V,
+ VectorOperation::values operation,
+ std::shared_ptr<const CommunicationPatternBase> communication_pattern)
{
// If no communication pattern is given, create one. Otherwsie, use the
// one given.
}
else
{
- epetra_comm_pattern.reset(
- dynamic_cast<const CommunicationPattern *> (communication_pattern));
+ epetra_comm_pattern =
+ std::dynamic_pointer_cast<const CommunicationPattern> (communication_pattern);
AssertThrow(epetra_comm_pattern != nullptr,
ExcMessage(std::string("The communication pattern is not of type ") +
"LinearAlgebra::EpetraWrappers::CommunicationPattern."));