From: Jean-Paul Pelteret Date: Fri, 7 Jan 2022 21:26:48 +0000 (+0100) Subject: Add MeshWorker::ScratchData::n_dofs_per_cell() X-Git-Tag: v9.4.0-rc1~398^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3696373fd78d6ce87c9a17b0020f9ac6938530b5;p=dealii.git Add MeshWorker::ScratchData::n_dofs_per_cell() --- diff --git a/include/deal.II/meshworker/scratch_data.h b/include/deal.II/meshworker/scratch_data.h index 0c97cadd73..1b7971987c 100644 --- a/include/deal.II/meshworker/scratch_data.h +++ b/include/deal.II/meshworker/scratch_data.h @@ -527,6 +527,13 @@ namespace MeshWorker const std::vector & get_local_dof_indices() const; + /** + * Return the number of local dof indices for the cell passed the last time + * the reinit() function was called. + */ + unsigned int + n_dofs_per_cell() const; + /** @} */ // CurrentCellMethods /** @@ -606,6 +613,13 @@ namespace MeshWorker const std::vector & get_neighbor_dof_indices() const; + /** + * Return the number of local dof indices for the neighbor passed the last + * time the reinit_neighbor() function was called. + */ + unsigned int + n_neighbor_dofs_per_cell() const; + /** @} */ // NeighborCellMethods /** diff --git a/source/meshworker/scratch_data.cc b/source/meshworker/scratch_data.cc index 208acece0b..6d5394f341 100644 --- a/source/meshworker/scratch_data.cc +++ b/source/meshworker/scratch_data.cc @@ -516,7 +516,6 @@ namespace MeshWorker neighbor_dof_indices.resize(neighbor_fe.n_dofs_per_cell()); cell->get_dof_indices(neighbor_dof_indices); - cell->get_dof_indices(neighbor_dof_indices); current_neighbor_fe_values = &neighbor_fe_subface_values; return neighbor_fe_subface_values; @@ -618,6 +617,15 @@ namespace MeshWorker + template + unsigned int + ScratchData::n_dofs_per_cell() const + { + return local_dof_indices.size(); + } + + + template const std::vector & ScratchData::get_neighbor_dof_indices() const @@ -627,6 +635,15 @@ namespace MeshWorker + template + unsigned int + ScratchData::n_neighbor_dofs_per_cell() const + { + return neighbor_dof_indices.size(); + } + + + template GeneralDataStorage & ScratchData::get_general_data_storage()