]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add MeshWorker::ScratchData::n_dofs_per_cell()
authorJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 7 Jan 2022 21:26:48 +0000 (22:26 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Tue, 8 Mar 2022 19:12:19 +0000 (20:12 +0100)
include/deal.II/meshworker/scratch_data.h
source/meshworker/scratch_data.cc

index 0c97cadd73a7d55729fc1e7f153f1ab0aa83a572..1b7971987c9d51799e9793d6804eec7ed7c91c69 100644 (file)
@@ -527,6 +527,13 @@ namespace MeshWorker
     const std::vector<types::global_dof_index> &
     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<types::global_dof_index> &
     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
 
     /**
index 208acece0b39b8edf32c43db85f72ce0ef8094a7..6d5394f341aa6ea6cd2c10f31d2062eccef182f4 100644 (file)
@@ -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 <int dim, int spacedim>
+  unsigned int
+  ScratchData<dim, spacedim>::n_dofs_per_cell() const
+  {
+    return local_dof_indices.size();
+  }
+
+
+
   template <int dim, int spacedim>
   const std::vector<types::global_dof_index> &
   ScratchData<dim, spacedim>::get_neighbor_dof_indices() const
@@ -627,6 +635,15 @@ namespace MeshWorker
 
 
 
+  template <int dim, int spacedim>
+  unsigned int
+  ScratchData<dim, spacedim>::n_neighbor_dofs_per_cell() const
+  {
+    return neighbor_dof_indices.size();
+  }
+
+
+
   template <int dim, int spacedim>
   GeneralDataStorage &
   ScratchData<dim, spacedim>::get_general_data_storage()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.