#include <deal.II/base/aligned_vector.h>
#include <deal.II/base/exceptions.h>
+#include <deal.II/base/numbers.h>
#include <deal.II/base/quadrature.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/thread_local_storage.h>
*/
unsigned int
get_cell_active_fe_index(
- const std::pair<unsigned int, unsigned int> range) const;
+ const std::pair<unsigned int, unsigned int> range,
+ const unsigned int dof_handler_index = numbers::invalid_unsigned_int) const;
/**
* In the hp-adaptive case, return the active FE index of a face range.
*/
unsigned int
- get_face_active_fe_index(const std::pair<unsigned int, unsigned int> range,
- const bool is_interior_face = true) const;
+ get_face_active_fe_index(
+ const std::pair<unsigned int, unsigned int> range,
+ const bool is_interior_face = true,
+ const unsigned int dof_handler_index = numbers::invalid_unsigned_int) const;
/** @} */
*/
unsigned int
get_cell_range_category(
- const std::pair<unsigned int, unsigned int> cell_batch_range) const;
+ const std::pair<unsigned int, unsigned int> cell_batch_range,
+ const unsigned int dof_handler_index = numbers::invalid_unsigned_int) const;
/**
* Return the category of the cells on the two sides of the current batch
*/
std::pair<unsigned int, unsigned int>
get_face_range_category(
- const std::pair<unsigned int, unsigned int> face_batch_range) const;
+ const std::pair<unsigned int, unsigned int> face_batch_range,
+ const unsigned int dof_handler_index = numbers::invalid_unsigned_int) const;
/**
* Return the category the current batch of cells was assigned to. Categories
* enabled, it is guaranteed that all cells have the same category.
*/
unsigned int
- get_cell_category(const unsigned int cell_batch_index) const;
+ get_cell_category(
+ const unsigned int cell_batch_index,
+ const unsigned int dof_handler_index = numbers::invalid_unsigned_int) const;
/**
* Return the category of the cells on the two sides of the current batch of
* faces.
*/
std::pair<unsigned int, unsigned int>
- get_face_category(const unsigned int face_batch_index) const;
+ get_face_category(
+ const unsigned int face_batch_index,
+ const unsigned int dof_handler_index = numbers::invalid_unsigned_int) const;
/**
* Queries whether or not the indexation has been set.
* Stores the index of the first DoFHandler that is in hp-mode. If no
* DoFHandler is in hp-mode, the value is 0.
*/
-public:
unsigned int first_hp_dof_handler_index;
};
template <int dim, typename Number, typename VectorizedArrayType>
unsigned int
MatrixFree<dim, Number, VectorizedArrayType>::get_cell_active_fe_index(
- const std::pair<unsigned int, unsigned int> range) const
+ const std::pair<unsigned int, unsigned int> range,
+ const unsigned int dof_handler_index) const
{
- const auto &fe_indices =
- dof_info[first_hp_dof_handler_index].cell_active_fe_index;
+ const unsigned int dof_no =
+ dof_handler_index == numbers::invalid_unsigned_int ?
+ first_hp_dof_handler_index :
+ dof_handler_index;
+
+ const auto &fe_indices = dof_info[dof_no].cell_active_fe_index;
if (fe_indices.empty() == true ||
- dof_handlers[first_hp_dof_handler_index]->get_fe_collection().size() == 1)
+ dof_handlers[dof_no]->get_fe_collection().size() == 1)
return 0;
const auto index = fe_indices[range.first];
unsigned int
MatrixFree<dim, Number, VectorizedArrayType>::get_face_active_fe_index(
const std::pair<unsigned int, unsigned int> range,
- const bool is_interior_face) const
+ const bool is_interior_face,
+ const unsigned int dof_handler_index) const
{
- const auto &fe_indices =
- dof_info[first_hp_dof_handler_index].cell_active_fe_index;
+ const unsigned int dof_no =
+ dof_handler_index == numbers::invalid_unsigned_int ?
+ first_hp_dof_handler_index :
+ dof_handler_index;
+
+ const auto &fe_indices = dof_info[dof_no].cell_active_fe_index;
if (fe_indices.empty() == true)
return 0;
template <int dim, typename Number, typename VectorizedArrayType>
inline unsigned int
MatrixFree<dim, Number, VectorizedArrayType>::get_cell_range_category(
- const std::pair<unsigned int, unsigned int> range) const
+ const std::pair<unsigned int, unsigned int> range,
+ const unsigned int dof_handler_index) const
{
- auto result = get_cell_category(range.first);
+ auto result = get_cell_category(range.first, dof_handler_index);
for (unsigned int i = range.first; i < range.second; ++i)
- result = std::max(result, get_cell_category(i));
+ result = std::max(result, get_cell_category(i, dof_handler_index));
return result;
}
template <int dim, typename Number, typename VectorizedArrayType>
inline std::pair<unsigned int, unsigned int>
MatrixFree<dim, Number, VectorizedArrayType>::get_face_range_category(
- const std::pair<unsigned int, unsigned int> range) const
+ const std::pair<unsigned int, unsigned int> range,
+ const unsigned int dof_handler_index) const
{
- auto result = get_face_category(range.first);
+ auto result = get_face_category(range.first, dof_handler_index);
for (unsigned int i = range.first; i < range.second; ++i)
{
- result.first = std::max(result.first, get_face_category(i).first);
- result.second = std::max(result.second, get_face_category(i).second);
+ result.first =
+ std::max(result.first, get_face_category(i, dof_handler_index).first);
+ result.second =
+ std::max(result.second, get_face_category(i, dof_handler_index).second);
}
return result;
template <int dim, typename Number, typename VectorizedArrayType>
inline unsigned int
MatrixFree<dim, Number, VectorizedArrayType>::get_cell_category(
- const unsigned int cell_batch_index) const
+ const unsigned int cell_batch_index,
+ const unsigned int dof_handler_index) const
{
AssertIndexRange(0, dof_info.size());
- AssertIndexRange(
- cell_batch_index,
- dof_info[first_hp_dof_handler_index].cell_active_fe_index.size());
- if (dof_info[first_hp_dof_handler_index].cell_active_fe_index.empty())
+
+ const unsigned int dof_no =
+ dof_handler_index == numbers::invalid_unsigned_int ?
+ first_hp_dof_handler_index :
+ dof_handler_index;
+
+ AssertIndexRange(cell_batch_index,
+ dof_info[dof_no].cell_active_fe_index.size());
+ if (dof_info[dof_no].cell_active_fe_index.empty())
return 0;
else
- return dof_info[first_hp_dof_handler_index]
- .cell_active_fe_index[cell_batch_index];
+ return dof_info[dof_no].cell_active_fe_index[cell_batch_index];
}
template <int dim, typename Number, typename VectorizedArrayType>
inline std::pair<unsigned int, unsigned int>
MatrixFree<dim, Number, VectorizedArrayType>::get_face_category(
- const unsigned int face_batch_index) const
+ const unsigned int face_batch_index,
+ const unsigned int dof_handler_index) const
{
+ const unsigned int dof_no =
+ dof_handler_index == numbers::invalid_unsigned_int ?
+ first_hp_dof_handler_index :
+ dof_handler_index;
+
AssertIndexRange(face_batch_index, face_info.faces.size());
- if (dof_info[first_hp_dof_handler_index].cell_active_fe_index.empty())
+ if (dof_info[dof_no].cell_active_fe_index.empty())
return std::make_pair(0U, 0U);
std::pair<unsigned int, unsigned int> result = std::make_pair(0U, 0U);
face_info.faces[face_batch_index].cells_interior[v] !=
numbers::invalid_unsigned_int;
++v)
- result.first =
- std::max(result.first,
- dof_info[first_hp_dof_handler_index].cell_active_fe_index
- [face_info.faces[face_batch_index].cells_interior[v] /
- VectorizedArrayType::size()]);
+ result.first = std::max(
+ result.first,
+ dof_info[dof_no].cell_active_fe_index[face_info.faces[face_batch_index]
+ .cells_interior[v] /
+ VectorizedArrayType::size()]);
if (face_info.faces[face_batch_index].cells_exterior[0] !=
numbers::invalid_unsigned_int)
for (unsigned int v = 0;
face_info.faces[face_batch_index].cells_exterior[v] !=
numbers::invalid_unsigned_int;
++v)
- result.second =
- std::max(result.second,
- dof_info[first_hp_dof_handler_index].cell_active_fe_index
- [face_info.faces[face_batch_index].cells_exterior[v] /
- VectorizedArrayType::size()]);
+ result.second = std::max(
+ result.second,
+ dof_info[dof_no].cell_active_fe_index[face_info.faces[face_batch_index]
+ .cells_exterior[v] /
+ VectorizedArrayType::size()]);
else
result.second = numbers::invalid_unsigned_int;
return result;