, cell_vectorization_categories_strict(
cell_vectorization_categories_strict)
, allow_ghosted_vectors_in_loops(allow_ghosted_vectors_in_loops)
+ , store_ghost_cells(false)
, communicator_sm(MPI_COMM_SELF)
{}
, cell_vectorization_categories_strict(
other.cell_vectorization_categories_strict)
, allow_ghosted_vectors_in_loops(other.allow_ghosted_vectors_in_loops)
+ , store_ghost_cells(other.store_ghost_cells)
, communicator_sm(other.communicator_sm)
{}
cell_vectorization_categories_strict =
other.cell_vectorization_categories_strict;
allow_ghosted_vectors_in_loops = other.allow_ghosted_vectors_in_loops;
+ store_ghost_cells = other.store_ghost_cells;
communicator_sm = other.communicator_sm;
return *this;
*/
bool allow_ghosted_vectors_in_loops;
+ /**
+ * Option to control whether data should be generated on ghost cells.
+ * If set to true, the data on ghost cells will be generated.
+ * The default value is false.
+ */
+ bool store_ghost_cells;
+
/**
* Shared-memory MPI communicator. Default: MPI_COMM_SELF.
*/
const AdditionalData &additional_data)
{
cell_level_index.clear();
+ auto ghosted_cell_index = cell_level_index;
dof_handlers.resize(dof_handler_in.size());
for (unsigned int no = 0; no < dof_handler_in.size(); ++no)
dof_handlers[no] = dof_handler_in[no];
for (const auto &cell : tria.cell_iterators_on_level(0))
internal::MatrixFreeFunctions::resolve_cell(cell, cell_level_index);
+ Assert(additional_data.store_ghost_cells == false,
+ ExcMessage(
+ "Storing ghost cells is only supported for level operator."));
Assert(task_info.n_procs > 1 ||
cell_level_index.size() == tria.n_active_cells(),
ExcInternalError());
for (const auto &cell : tria.cell_iterators_on_level(level))
if (cell->is_locally_owned_on_level())
cell_level_index.emplace_back(cell->level(), cell->index());
+ else if (additional_data.store_ghost_cells == true &&
+ cell->is_ghost_on_level())
+ ghosted_cell_index.emplace_back(cell->level(), cell->index());
}
}
// All these are cells local to this processor. Therefore, set
// cell_level_index_end_local to the size of cell_level_index.
cell_level_index_end_local = cell_level_index.size();
+
+ Assert(ghosted_cell_index.size() == 0 || additional_data.store_ghost_cells,
+ ExcInternalError());
+
+ // If ghost cells are stored, add them to the end of the cell_level_index
+ cell_level_index.insert(cell_level_index.end(),
+ ghosted_cell_index.begin(),
+ ghosted_cell_index.end());
}