initialize_import_indices_plain_dev();
# endif
- if (vector_operation != dealii::VectorOperation::insert)
+ if (vector_operation != VectorOperation::insert)
AssertDimension(n_ghost_targets + n_import_targets, requests.size());
// first wait for the receive to complete
if (requests.size() > 0 && n_import_targets > 0)
MemorySpaceType,
MemorySpace::Default>::value)
{
- if (vector_operation == dealii::VectorOperation::add)
+ if (vector_operation == VectorOperation::add)
{
for (auto const &import_indices_plain :
import_indices_plain_dev)
read_position += chunk_size;
}
}
- else if (vector_operation == dealii::VectorOperation::min)
+ else if (vector_operation == VectorOperation::min)
{
for (auto const &import_indices_plain :
import_indices_plain_dev)
read_position += chunk_size;
}
}
- else if (vector_operation == dealii::VectorOperation::max)
+ else if (vector_operation == VectorOperation::max)
{
for (auto const &import_indices_plain :
import_indices_plain_dev)
// local values. For insert, nothing is done here (but in debug
// mode we assert that the specified value is either zero or
// matches with the ones already present
- if (vector_operation == dealii::VectorOperation::add)
+ if (vector_operation == VectorOperation::add)
for (const auto &import_range : import_indices_data)
for (unsigned int j = import_range.first;
j < import_range.second;
j++)
locally_owned_array[j] += *read_position++;
- else if (vector_operation == dealii::VectorOperation::min)
+ else if (vector_operation == VectorOperation::min)
for (const auto &import_range : import_indices_data)
for (unsigned int j = import_range.first;
j < import_range.second;
locally_owned_array[j]);
read_position++;
}
- else if (vector_operation == dealii::VectorOperation::max)
+ else if (vector_operation == VectorOperation::max)
for (const auto &import_range : import_indices_data)
for (unsigned int j = import_range.first;
j < import_range.second;
post_unpack_action(std::vector<VectorType *> &all_out)
{
for (auto &out : all_out)
- out->compress(::dealii::VectorOperation::insert);
+ out->compress(VectorOperation::insert);
}
template <typename value_type>
* for more information.
*/
void
- compress(::dealii::VectorOperation::values operation);
+ compress(VectorOperation::values operation);
/**
* Multiply the entire matrix by a fixed factor.
template <class MatrixType>
inline void
-BlockMatrixBase<MatrixType>::compress(
- ::dealii::VectorOperation::values operation)
+BlockMatrixBase<MatrixType>::compress(VectorOperation::values operation)
{
for (unsigned int r = 0; r < n_block_rows(); ++r)
for (unsigned int c = 0; c < n_block_cols(); ++c)
* for more information.
*/
void
- compress(::dealii::VectorOperation::values operation =
- ::dealii::VectorOperation::unknown);
+ compress(VectorOperation::values operation = VectorOperation::unknown);
/**
* Returns `false` as this is a serial block vector.
template <typename Number>
inline void
-BlockVector<Number>::compress(::dealii::VectorOperation::values operation)
+BlockVector<Number>::compress(VectorOperation::values operation)
{
for (size_type i = 0; i < this->n_blocks(); ++i)
this->components[i].compress(operation);
* for more information.
*/
void
- compress(::dealii::VectorOperation::values operation);
+ compress(VectorOperation::values operation);
/**
* Access to a single block.
template <class VectorType>
inline void
-BlockVectorBase<VectorType>::compress(
- ::dealii::VectorOperation::values operation)
+BlockVectorBase<VectorType>::compress(VectorOperation::values operation)
{
for (unsigned int i = 0; i < n_blocks(); ++i)
block(i).compress(operation);
* elements do not agree.
*/
virtual void
- compress(::dealii::VectorOperation::values operation) override;
+ compress(VectorOperation::values operation) override;
/**
* Fills the data field for ghost indices with the values stored in the
template <typename Number>
void
- BlockVector<Number>::compress(::dealii::VectorOperation::values operation)
+ BlockVector<Number>::compress(VectorOperation::values operation)
{
const unsigned int n_chunks =
(this->n_blocks() + communication_block_size - 1) /
* after the second calculation will be zero.
*/
virtual void
- compress(::dealii::VectorOperation::values operation) override;
+ compress(VectorOperation::values operation) override;
/**
* Fills the data field for ghost indices with the values stored in the
* LinearAlgebra::distributed::BlockVector).
*/
void
- compress_start(
- const unsigned int communication_channel = 0,
- ::dealii::VectorOperation::values operation = VectorOperation::add);
+ compress_start(const unsigned int communication_channel = 0,
+ VectorOperation::values operation = VectorOperation::add);
/**
* For all requests that have been initiated in compress_start, wait for
* the device after the call to compress_start will be lost.
*/
void
- compress_finish(::dealii::VectorOperation::values operation);
+ compress_finish(VectorOperation::values operation);
/**
* Initiates communication for the @p update_ghost_values() function
static void
import_elements(
const ::dealii::LinearAlgebra::ReadWriteVector<Number> & /*V*/,
- ::dealii::VectorOperation::values /*operation*/,
+ VectorOperation::values /*operation*/,
const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner> &
/*communication_pattern*/,
const IndexSet & /*locally_owned_elem*/,
static void
import_elements(
const ::dealii::LinearAlgebra::ReadWriteVector<Number> &V,
- ::dealii::VectorOperation::values operation,
+ VectorOperation::values operation,
const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
& communication_pattern,
const IndexSet &locally_owned_elem,
&data)
{
Assert(
- (operation == ::dealii::VectorOperation::add) ||
- (operation == ::dealii::VectorOperation::insert),
+ (operation == VectorOperation::add) ||
+ (operation == VectorOperation::insert),
ExcMessage(
"Only VectorOperation::add and VectorOperation::insert are allowed"));
&data)
{
Assert(
- (operation == ::dealii::VectorOperation::add) ||
- (operation == ::dealii::VectorOperation::insert),
+ (operation == VectorOperation::add) ||
+ (operation == VectorOperation::insert),
ExcMessage(
"Only VectorOperation::add and VectorOperation::insert are allowed"));
template <typename Number, typename MemorySpaceType>
void
- Vector<Number, MemorySpaceType>::compress(
- ::dealii::VectorOperation::values operation)
+ Vector<Number, MemorySpaceType>::compress(VectorOperation::values operation)
{
compress_start(0, operation);
compress_finish(operation);
template <typename Number, typename MemorySpaceType>
void
Vector<Number, MemorySpaceType>::compress_start(
- const unsigned int communication_channel,
- ::dealii::VectorOperation::values operation)
+ const unsigned int communication_channel,
+ VectorOperation::values operation)
{
AssertIndexRange(communication_channel, 200);
Assert(vector_is_ghosted == false,
template <typename Number, typename MemorySpaceType>
void
Vector<Number, MemorySpaceType>::compress_finish(
- ::dealii::VectorOperation::values operation)
+ VectorOperation::values operation)
{
#ifdef DEAL_II_WITH_MPI
vector_is_ghosted = false;
for (size_type i = 0; i < v.size(); ++i)
(*this)(i) = v(i);
- compress(::dealii::VectorOperation::insert);
+ compress(VectorOperation::insert);
return *this;
}
{
static void
import(const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
- & communication_pattern,
- const Number * values,
- const ::dealii::VectorOperation::values operation,
+ & communication_pattern,
+ const Number * values,
+ const VectorOperation::values operation,
::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
{
(void)communication_pattern;
static void
import(const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
- & communication_pattern,
- const Number * values,
- const ::dealii::VectorOperation::values operation,
+ & communication_pattern,
+ const Number * values,
+ const VectorOperation::values operation,
::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
{
distributed::Vector<Number, ::dealii::MemorySpace::Host> tmp_vector(
static void
import(const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
- & communication_pattern,
- const Number * values,
- const ::dealii::VectorOperation::values operation,
+ & communication_pattern,
+ const Number * values,
+ const VectorOperation::values operation,
::dealii::LinearAlgebra::ReadWriteVector<Number> &rw_vector)
{
distributed::Vector<Number, ::dealii::MemorySpace::Host> tmp_vector(
additional_data->relaxation * x_cell(row_cell);
}
}
- dst.compress(dealii::VectorOperation::add);
+ dst.compress(VectorOperation::add);
}
/**
* Dummy function for compatibility with distributed, parallel matrices.
*/
- void compress(::dealii::VectorOperation::values);
+ void compress(VectorOperation::values);
/** @} */
/**
template <typename number>
-void SparseMatrix<number>::compress(::dealii::VectorOperation::values)
+void SparseMatrix<number>::compress(VectorOperation::values)
{}
* for more information.
*/
void
- compress(::dealii::VectorOperation::values operation);
+ compress(VectorOperation::values operation);
/**
* Set the element (<i>i,j</i>) to @p value.
* for more information.
*/
void
- compress(::dealii::VectorOperation::values operation);
+ compress(VectorOperation::values operation);
/**
* Set all components of the vector to the given number @p s. Simply
* an empty function.
*/
void
- compress(::dealii::VectorOperation::values operation =
- ::dealii::VectorOperation::unknown) const;
+ compress(VectorOperation::values operation = VectorOperation::unknown) const;
/**
* Change the dimension of the vector to @p N. The reserved memory for this
template <typename Number>
-inline void Vector<Number>::compress(::dealii::VectorOperation::values) const
+inline void Vector<Number>::compress(VectorOperation::values) const
{}
{
(void)component_in_block_vector;
Assert(vec.has_ghost_elements() == false, ExcNotImplemented());
- vec.compress(dealii::VectorOperation::add);
+ vec.compress(VectorOperation::add);
}
AssertDimension(requests.size(), tmp_data.size());
part.import_from_ghosted_array_start(
- dealii::VectorOperation::add,
+ VectorOperation::add,
component_in_block_vector * 2 + channel_shift,
ArrayView<Number>(vec.begin(), part.locally_owned_size()),
vec.shared_vector_data(),
VectorType & vec)
{
(void)component_in_block_vector;
- vec.compress_finish(dealii::VectorOperation::add);
+ vec.compress_finish(VectorOperation::add);
}
const unsigned int channel = 0)
{
if (get_communication_block_size(vec) < vec.n_blocks())
- vec.compress(dealii::VectorOperation::add);
+ vec.compress(VectorOperation::add);
else
for (unsigned int i = 0; i < vec.n_blocks(); ++i)
compress_start(vec.block(i), exchanger, channel + i);
embedded_partitioner
->template import_from_ghosted_array_start<Number, MemorySpace::Host>(
- dealii::VectorOperation::add,
+ VectorOperation::add,
0,
dealii::ArrayView<Number>(
const_cast<Number *>(vec.begin()) +
embedded_partitioner
->template import_from_ghosted_array_finish<Number, MemorySpace::Host>(
- dealii::VectorOperation::add,
+ VectorOperation::add,
dealii::ArrayView<const Number>(buffer.begin(), buffer.size()),
dealii::ArrayView<Number>(vec.begin(),
embedded_partitioner->locally_owned_size()),
void
post_unpack_action(VectorType &out)
{
- out.compress(::dealii::VectorOperation::insert);
+ out.compress(VectorOperation::insert);
}
template <typename value_type>
// Communicate the results.
- out.compress(dealii::VectorOperation::insert);
+ out.compress(VectorOperation::insert);
// Treat hanging nodes
std::vector<types::global_dof_index> dof_indices;
{
// finalize valence: compress and invert
using Number = typename VectorType::value_type;
- valence.compress(::dealii::VectorOperation::add);
+ valence.compress(VectorOperation::add);
for (const auto i : valence.locally_owned_elements())
valence[i] = (static_cast<Number>(valence[i]) == Number() ?
Number() :
(Number(1.0) / static_cast<Number>(valence[i])));
- valence.compress(::dealii::VectorOperation::insert);
+ valence.compress(VectorOperation::insert);
for (const auto vec : all_out)
{
// compress and weight with valence
- vec->compress(::dealii::VectorOperation::add);
+ vec->compress(VectorOperation::add);
vec->scale(valence);
}
}
else
{
for (const auto vec : all_out)
- vec->compress(::dealii::VectorOperation::insert);
+ vec->compress(VectorOperation::insert);
}
input_vectors.clear();
void
MatrixBase::reinit(Mat A)
{
- AssertThrow(last_action == ::dealii::VectorOperation::unknown,
+ AssertThrow(last_action == VectorOperation::unknown,
ExcMessage("Cannot assign a new Mat."));
PetscErrorCode ierr =
PetscObjectReference(reinterpret_cast<PetscObject>(A));
ierr = MatMPIAIJSetPreallocationCSR(matrix, &i, &i, nullptr);
AssertThrow(ierr == 0, ExcPETScError(ierr));
}
- compress(dealii::VectorOperation::insert);
+ compress(VectorOperation::insert);
{
close_matrix(matrix);
ierr = MatSeqAIJSetPreallocationCSR(local_matrix, &i, &i, nullptr);
AssertThrow(ierr == 0, ExcPETScError(ierr));
}
- compress(dealii::VectorOperation::insert);
+ compress(VectorOperation::insert);
{
close_matrix(local_matrix);
VectorBase::VectorBase()
: vector(nullptr)
, ghosted(false)
- , last_action(::dealii::VectorOperation::unknown)
+ , last_action(VectorOperation::unknown)
{}
: Subscriptor()
, ghosted(v.ghosted)
, ghost_indices(v.ghost_indices)
- , last_action(::dealii::VectorOperation::unknown)
+ , last_action(VectorOperation::unknown)
{
PetscErrorCode ierr = VecDuplicate(v.vector, &vector);
AssertThrow(ierr == 0, ExcPETScError(ierr));
: Subscriptor()
, vector(v)
, ghosted(false)
- , last_action(::dealii::VectorOperation::unknown)
+ , last_action(VectorOperation::unknown)
{
/* TODO GHOSTED */
const PetscErrorCode ierr =
VectorBase::reinit(Vec v)
{
/* TODO GHOSTED */
- AssertThrow(last_action == ::dealii::VectorOperation::unknown,
+ AssertThrow(last_action == VectorOperation::unknown,
ExcMessage("Cannot assign a new Vec"));
PetscErrorCode ierr =
PetscObjectReference(reinterpret_cast<PetscObject>(v));
ghosted = false;
ghost_indices.clear();
- last_action = ::dealii::VectorOperation::unknown;
+ last_action = VectorOperation::unknown;
}
get_mpi_communicator());
AssertThrowMPI(ierr);
- AssertThrow(all_int_last_action != (::dealii::VectorOperation::add |
- ::dealii::VectorOperation::insert),
+ AssertThrow(all_int_last_action !=
+ (VectorOperation::add | VectorOperation::insert),
ExcMessage("Error: not all processors agree on the last "
"VectorOperation before this compress() call."));
# endif
}
AssertThrow(
- last_action == ::dealii::VectorOperation::unknown ||
- last_action == operation,
+ last_action == VectorOperation::unknown || last_action == operation,
ExcMessage(
"Missing compress() or calling with wrong VectorOperation argument."));
// reset the last action field to
// indicate that we're back to a
// pristine state
- last_action = ::dealii::VectorOperation::unknown;
+ last_action = VectorOperation::unknown;
}
const PetscScalar *values,
const bool add_values)
{
- ::dealii::VectorOperation::values action =
- (add_values ? ::dealii::VectorOperation::add :
- ::dealii::VectorOperation::insert);
- Assert((last_action == action) ||
- (last_action == ::dealii::VectorOperation::unknown),
+ VectorOperation::values action =
+ (add_values ? VectorOperation::add : VectorOperation::insert);
+ Assert((last_action == action) || (last_action == VectorOperation::unknown),
internal::VectorReference::ExcWrongMode(action, last_action));
Assert(!has_ghost_elements(), ExcGhostsPresent());
// VecSetValues complains if we
void
- SparseMatrix::compress(::dealii::VectorOperation::values operation)
+ SparseMatrix::compress(VectorOperation::values operation)
{
Epetra_CombineMode mode = last_action;
if (last_action == Zero)
{
- if ((operation == ::dealii::VectorOperation::add) ||
- (operation == ::dealii::VectorOperation::unknown))
+ if ((operation == VectorOperation::add) ||
+ (operation == VectorOperation::unknown))
mode = Add;
- else if (operation == ::dealii::VectorOperation::insert)
+ else if (operation == VectorOperation::insert)
mode = Insert;
else
Assert(
}
else
{
- Assert(((last_action == Add) &&
- (operation != ::dealii::VectorOperation::insert)) ||
- ((last_action == Insert) &&
- (operation != ::dealii::VectorOperation::add)),
- ExcMessage("Operation and argument to compress() do not match"));
+ Assert(
+ ((last_action == Add) && (operation != VectorOperation::insert)) ||
+ ((last_action == Insert) && (operation != VectorOperation::add)),
+ ExcMessage("Operation and argument to compress() do not match"));
}
// flush buffers
SparseMatrix::operator=(const double d)
{
Assert(d == 0, ExcScalarAssignmentOnlyForZeroValue());
- compress(
- ::dealii::VectorOperation::unknown); // TODO: why do we do this? Should we
- // not check for is_compressed?
+ compress(VectorOperation::unknown); // TODO: why do we do this? Should we
+ // not check for is_compressed?
const int ierr = matrix->PutScalar(d);
AssertThrow(ierr == 0, ExcTrilinosError(ierr));
void
- Vector::compress(::dealii::VectorOperation::values given_last_action)
+ Vector::compress(VectorOperation::values given_last_action)
{
// Select which mode to send to Trilinos. Note that we use last_action if
// available and ignore what the user tells us to detect wrongly mixed
Epetra_CombineMode mode = last_action;
if (last_action == Zero)
{
- if (given_last_action == ::dealii::VectorOperation::add)
+ if (given_last_action == VectorOperation::add)
mode = Add;
- else if (given_last_action == ::dealii::VectorOperation::insert)
+ else if (given_last_action == VectorOperation::insert)
mode = Insert;
else
Assert(
{
Assert(
((last_action == Add) &&
- (given_last_action == ::dealii::VectorOperation::add)) ||
+ (given_last_action == VectorOperation::add)) ||
((last_action == Insert) &&
- (given_last_action == ::dealii::VectorOperation::insert)),
+ (given_last_action == VectorOperation::insert)),
ExcMessage(
"The last operation on the Vector and the given last action in the compress() call do not agree!"));
}
(void)data_others;
(void)operation;
- Assert(operation == dealii::VectorOperation::add, ExcNotImplemented());
+ Assert(operation == VectorOperation::add, ExcNotImplemented());
requests.resize(sm_ghost_ranks.size() + sm_import_ranks.size() +
ghost_targets_data.size() + import_targets_data.size());
(void)operation;
- Assert(operation == dealii::VectorOperation::add, ExcNotImplemented());
+ Assert(operation == VectorOperation::add, ExcNotImplemented());
AssertDimension(requests.size(),
sm_ghost_ranks.size() + sm_import_ranks.size() +