reinit_faces(const std::vector<FERemoteCommunicationObjectEntityBatches<dim>>
&comm_objects,
const std::pair<unsigned int, unsigned int> &face_batch_range,
- const std::vector<Quadrature<dim>> &quadrature_vector);
+ const std::vector<unsigned int> &quadrature_sizes);
/**
* This function stores given communication objects
reinit_faces(
const std::vector<FERemoteCommunicationObject<dim>> &comm_objects,
const std::pair<unsigned int, unsigned int> &face_range,
- const std::vector<Quadrature<dim - 1>> &quadrature_vector);
+ const std::vector<unsigned int> &quadrature_sizes);
/**
* This function stores given communication objects
void
reinit_faces(
const std::vector<FERemoteCommunicationObjectTwoLevel<dim>> &comm_objects,
- const IteratorRange<Iterator> &cell_iterator_range,
- const std::vector<std::vector<Quadrature<dim - 1>>> &quadrature_vector);
+ const IteratorRange<Iterator> &cell_iterator_range,
+ const std::vector<std::vector<unsigned int>> &quadrature_sizes);
const std::vector<FERemoteCommunicationObjectEntityBatches<dim>>
&comm_objects,
const std::pair<unsigned int, unsigned int> &face_batch_range,
- const std::vector<Quadrature<dim>> &quadrature_vector)
+ const std::vector<unsigned int> &quadrature_sizes)
{
// erase type by converting to the base object
communication_objects.clear();
communication_objects.push_back(co);
// fetch points and update communication patterns
- const unsigned int n_cells = quadrature_vector.size();
+ const unsigned int n_cells = quadrature_sizes.size();
AssertDimension(n_cells, face_batch_range.second - face_batch_range.first);
// construct view:
view.ptrs[0] = 0;
for (unsigned int face = 0; face < n_cells; ++face)
{
- view.ptrs[face + 1] = view.ptrs[face] + quadrature_vector[face].size();
+ view.ptrs[face + 1] = view.ptrs[face] + quadrature_sizes[face];
}
}
FERemoteEvaluationCommunicator<dim>::reinit_faces(
const std::vector<FERemoteCommunicationObject<dim>> &comm_objects,
const std::pair<unsigned int, unsigned int> &face_range,
- const std::vector<Quadrature<dim - 1>> &quadrature_vector)
+ const std::vector<unsigned int> &quadrature_sizes)
{
// erase type
communication_objects.clear();
for (const auto &co : comm_objects)
communication_objects.push_back(co);
- const unsigned int n_faces = quadrature_vector.size();
+ const unsigned int n_faces = quadrature_sizes.size();
AssertDimension(n_faces, face_range.second - face_range.first);
// construct view:
view.ptrs[0] = 0;
for (unsigned int face = 0; face < n_faces; ++face)
- view.ptrs[face + 1] = view.ptrs[face] + quadrature_vector[face].size();
+ view.ptrs[face + 1] = view.ptrs[face] + quadrature_sizes[face];
}
template <int dim>
void
FERemoteEvaluationCommunicator<dim>::reinit_faces(
const std::vector<FERemoteCommunicationObjectTwoLevel<dim>> &comm_objects,
- const IteratorRange<Iterator> &cell_iterator_range,
- const std::vector<std::vector<Quadrature<dim - 1>>> &quadrature_vector)
+ const IteratorRange<Iterator> &cell_iterator_range,
+ const std::vector<std::vector<unsigned int>> &quadrature_sizes)
{
// erase type
communication_objects.clear();
for (const auto &co : comm_objects)
communication_objects.push_back(co);
- const unsigned int n_cells = quadrature_vector.size();
+ const unsigned int n_cells = quadrature_sizes.size();
AssertDimension(n_cells,
std::distance(cell_iterator_range.begin(),
cell_iterator_range.end()));
face_ptrs[face_index + 1] =
face_ptrs[face_index] +
- quadrature_vector[cell->active_cell_index()][f].size();
+ quadrature_sizes[cell->active_cell_index()][f];
}
}
}
std::vector<FERemoteCommunicationObjectEntityBatches<dim>> comm_objects;
// Additionally to the communication objects we need a vector
- // that stores quadrature rules for every face batch.
- // The quadrature can be empty in case of non non-matching faces,
+ // that stores quadrature rule sizes for every face batch.
+ // The quadrature can have size zero in case of non non-matching faces,
// i.e. boundary faces. Internally this information is needed to correctly
// access values over multiple communication objects.
- std::vector<Quadrature<dim>> global_quadrature_vector(
- matrix_free.n_boundary_face_batches());
+ std::vector<unsigned int> global_quadrature_sizes(
+ matrix_free.n_boundary_face_batches(), numbers::invalid_unsigned_int);
// Get the range of face batches we have to look at during construction of
// the communication objects. We only have to look at boundary faces.
}
}
- // Insert a quadrature rule of correct size into the global
- // quadrature vector. First check that each face is only
- // considered once.
- Assert(global_quadrature_vector[bface].size() == 0,
+ // Insert the quadrature size into the global vector.
+ // First check that each face is only considered once.
+ Assert(global_quadrature_sizes[bface] ==
+ numbers::invalid_unsigned_int,
ExcMessage(
"Quadrature for given face already provided."));
- global_quadrature_vector[bface] =
- Quadrature<dim>(phi.n_q_points);
+ global_quadrature_sizes[bface] = phi.n_q_points;
}
}
remote_communicator.reinit_faces(comm_objects,
face_batch_range,
- global_quadrature_vector);
+ global_quadrature_sizes);
return remote_communicator;
}
// Reinit the communicator with the communication objects.
FERemoteEvaluationCommunicator<dim> remote_communicator;
+ std::vector<unsigned int> global_quadrature_sizes(
+ global_quadrature_vector.size());
+ std::transform(global_quadrature_vector.cbegin(),
+ global_quadrature_vector.cend(),
+ global_quadrature_sizes.begin(),
+ [](const auto &q) { return q.size(); });
+
remote_communicator.reinit_faces(
comm_objects,
std::make_pair(0, global_quadrature_vector.size()),
- global_quadrature_vector);
+ global_quadrature_sizes);
if (nm_mapping_info != nullptr)
{
// Fill a quadrature vector to keep track of the quadrature sizes on each
// face
- std::vector<Quadrature<dim>> quadrature_vector(
+ std::vector<unsigned int> quadrature_sizes(
matrix_free.n_boundary_face_batches());
// Points that are searched by rpe.
}
}
- // append quadrature of correct size
- quadrature_vector[bface] = Quadrature<dim>(phi.n_q_points);
+ // append quadrature size
+ quadrature_sizes[bface] = phi.n_q_points;
}
// use rpe to search for stored points
// Renit the communicator `FERemoteEvaluationCommunicator`
// with the communication objects.
FERemoteEvaluationCommunicator<dim> remote_communicator;
- remote_communicator.reinit_faces({co}, face_batch_range, quadrature_vector);
+ remote_communicator.reinit_faces({co}, face_batch_range, quadrature_sizes);
return remote_communicator;
}
matrix_free.n_inner_face_batches() +
matrix_free.n_boundary_face_batches());
- // Fill a quadrature vector to keep track of the quadrature sizes on each
- // cell, face pair
- std::vector<std::vector<Quadrature<dim - 1>>> quadrature_vector;
+ // Fill a vector of quadrature sizes for each cell, face pair
+ std::vector<std::vector<unsigned int>> quadrature_sizes;
for (const auto &cell : matrix_free.get_dof_handler()
.get_triangulation()
.active_cell_iterators())
- quadrature_vector.emplace_back(
- std::vector<Quadrature<dim - 1>>(cell->n_faces()));
+ quadrature_sizes.emplace_back(std::vector<unsigned int>(cell->n_faces()));
// Points that are searched by rpe.
std::vector<Point<dim>> points;
points.push_back(temp);
}
- // append quadrature of correct size
- quadrature_vector[cell->active_cell_index()][f] =
- Quadrature<dim - 1>(phi.n_q_points);
+ // append correct quadrature size
+ quadrature_sizes[cell->active_cell_index()][f] = phi.n_q_points;
}
}
remote_communicator.reinit_faces(
{co},
matrix_free.get_dof_handler().get_triangulation().active_cell_iterators(),
- quadrature_vector);
+ quadrature_sizes);
return remote_communicator;
}
matrix_free.n_inner_face_batches() +
matrix_free.n_boundary_face_batches());
- // Fill a quadrature vector to keep track of the quadrature sizes on each
- // face
- std::vector<Quadrature<dim>> quadrature_vector(
+ // Fill a vector to keep track of the quadrature sizes on each face
+ std::vector<unsigned int> quadrature_sizes(
matrix_free.n_boundary_face_batches());
// Points that are searched by rpe.
}
// append quadrature of correct size
- quadrature_vector[bface] = Quadrature<dim>(phi.n_q_points);
+ quadrature_sizes[bface] = phi.n_q_points;
}
// use rpe to search for stored points
// Renit the communicator `FERemoteEvaluationCommunicator`
// with the communication objects.
FERemoteEvaluationCommunicator<dim> remote_communicator;
- remote_communicator.reinit_faces({co}, face_batch_range, quadrature_vector);
+ remote_communicator.reinit_faces({co}, face_batch_range, quadrature_sizes);
return remote_communicator;
}
// Fill a quadrature vector to keep track of the quadrature sizes on each
// cell, face pair
- std::vector<std::vector<Quadrature<dim - 1>>> quadrature_vector;
+ std::vector<std::vector<unsigned int>> quadrature_sizes;
for (const auto &cell : matrix_free.get_dof_handler()
.get_triangulation()
.active_cell_iterators())
- quadrature_vector.emplace_back(
- std::vector<Quadrature<dim - 1>>(cell->n_faces()));
+ quadrature_sizes.emplace_back(std::vector<unsigned int>(cell->n_faces()));
// Points that are searched by rpe.
std::vector<Point<dim>> points;
}
// append quadrature of correct size
- quadrature_vector[cell->active_cell_index()][f] =
- Quadrature<dim - 1>(phi.n_q_points);
+ quadrature_sizes[cell->active_cell_index()][f] = phi.n_q_points;
}
}
remote_communicator.reinit_faces(
{co},
matrix_free.get_dof_handler().get_triangulation().active_cell_iterators(),
- quadrature_vector);
+ quadrature_sizes);
return remote_communicator;
}