From 935f4e6227c87e2f2e9261beef1d53e02572e733 Mon Sep 17 00:00:00 2001
From: Jean-Paul Pelteret <jppelteret@gmail.com>
Date: Fri, 23 Dec 2022 12:12:23 +0100
Subject: [PATCH] Add ScratchData::reinit() for interfaces that does not
 require arguments for the subfaces

---
 include/deal.II/meshworker/scratch_data.h | 21 +++++++++++++++++++++
 source/meshworker/scratch_data.cc         | 19 +++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/include/deal.II/meshworker/scratch_data.h b/include/deal.II/meshworker/scratch_data.h
index ee2d98b17d..2d2423d64f 100644
--- a/include/deal.II/meshworker/scratch_data.h
+++ b/include/deal.II/meshworker/scratch_data.h
@@ -459,6 +459,27 @@ namespace MeshWorker
            const unsigned int face_no,
            const unsigned int subface_no);
 
+    /**
+     * Initialize the internal FEInterfaceValues with the given arguments, and
+     * return a reference to it.
+     *
+     * After calling this function, get_local_dof_indices(),
+     * get_quadrature_points(), get_normal_vectors(), and get_JxW_values() will
+     * be forwarded to the local FEInterfaceValues object. The methods
+     * get_current_fe_values() will return the FEValuesBase associated to the
+     * current cell, while get_neighbor_fe_values() will be associated with the
+     * neighbor cell. The method get_local_dof_indices() will return the
+     * same result of FEInterfaceValues::get_interface_dof_indices(),
+     * while the get_neighbor_dof_indices() will return the local dof indices
+     * of the neighbor cell.
+     */
+    const FEInterfaceValues<dim, spacedim> &
+    reinit(const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
+           const unsigned int face_no,
+           const typename DoFHandler<dim, spacedim>::active_cell_iterator
+             &                cell_neighbor,
+           const unsigned int face_no_neighbor);
+
     /**
      * Initialize the internal FEInterfaceValues with the given arguments, and
      * return a reference to it.
diff --git a/source/meshworker/scratch_data.cc b/source/meshworker/scratch_data.cc
index 434307edad..fedca84bc4 100644
--- a/source/meshworker/scratch_data.cc
+++ b/source/meshworker/scratch_data.cc
@@ -433,6 +433,25 @@ namespace MeshWorker
 
 
 
+  template <int dim, int spacedim>
+  const FEInterfaceValues<dim, spacedim> &
+  ScratchData<dim, spacedim>::reinit(
+    const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
+    const unsigned int                                              face_no,
+    const typename DoFHandler<dim, spacedim>::active_cell_iterator
+      &                cell_neighbor,
+    const unsigned int face_no_neighbor)
+  {
+    return reinit(cell,
+                  face_no,
+                  numbers::invalid_unsigned_int,
+                  cell_neighbor,
+                  face_no_neighbor,
+                  numbers::invalid_unsigned_int);
+  }
+
+
+
   template <int dim, int spacedim>
   const FEInterfaceValues<dim, spacedim> &
   ScratchData<dim, spacedim>::reinit(
-- 
2.39.5