From 2e4f9662a884c9673eadb0408ecd2d156f7b11a4 Mon Sep 17 00:00:00 2001
From: Rene Gassmoeller <rene.gassmoeller@mailbox.org>
Date: Wed, 5 Apr 2023 06:53:27 -0400
Subject: [PATCH] Create copy and assignment constructor

---
 .../deal.II/matrix_free/fe_point_evaluation.h | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h
index 2cb90d108a..b3c2c59f4e 100644
--- a/include/deal.II/matrix_free/fe_point_evaluation.h
+++ b/include/deal.II/matrix_free/fe_point_evaluation.h
@@ -460,6 +460,16 @@ public:
                     const FiniteElement<dim> &               fe,
                     const unsigned int first_selected_component = 0);
 
+  /**
+   * Copy constructor.
+   */
+  FEPointEvaluation(FEPointEvaluation &other);
+
+  /**
+   * Move constructor.
+   */
+  FEPointEvaluation(FEPointEvaluation &&other);
+
   /**
    * Destructor.
    */
@@ -861,6 +871,76 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::FEPointEvaluation(
 
 
 
+template <int n_components_, int dim, int spacedim, typename Number>
+FEPointEvaluation<n_components_, dim, spacedim, Number>::FEPointEvaluation(
+  FEPointEvaluation<n_components_, dim, spacedim, Number> &other)
+  : n_q_points(other.n_q_points)
+  , mapping(other.mapping)
+  , fe(other.fe)
+  , poly(other.poly)
+  , polynomials_are_hat_functions(other.polynomials_are_hat_functions)
+  , renumber(other.renumber)
+  , solution_renumbered(other.solution_renumbered)
+  , solution_renumbered_vectorized(other.solution_renumbered_vectorized)
+  , values(other.values)
+  , unit_gradients(other.unit_gradients)
+  , gradients(other.gradients)
+  , dofs_per_component(other.dofs_per_component)
+  , component_in_base_element(other.component_in_base_element)
+  , nonzero_shape_function_component(other.nonzero_shape_function_component)
+  , update_flags(other.update_flags)
+  , fe_values(other.fe_values)
+  , mapping_info(other.mapping_info)
+  , current_cell_index(other.current_cell_index)
+  , current_face_number(other.current_face_number)
+  , fast_path(other.fast_path)
+  , is_reinitialized(false)
+  , shapes(other.shapes)
+{
+  if (other.mapping_info_on_the_fly)
+    mapping_info_on_the_fly.reset(new NonMatching::MappingInfo<dim, spacedim>(*mapping,
+                                                                update_flags));
+
+  connection_is_reinitialized = mapping_info->connect_is_reinitialized(
+    [this]() { this->is_reinitialized = false; });
+}
+
+
+
+template <int n_components_, int dim, int spacedim, typename Number>
+FEPointEvaluation<n_components_, dim, spacedim, Number>::FEPointEvaluation(
+  FEPointEvaluation<n_components_, dim, spacedim, Number> &&other)
+  : n_q_points(other.n_q_points)
+  , mapping(other.mapping)
+  , fe(other.fe)
+  , poly(other.poly)
+  , polynomials_are_hat_functions(other.polynomials_are_hat_functions)
+  , renumber(other.renumber)
+  , solution_renumbered(other.solution_renumbered)
+  , solution_renumbered_vectorized(other.solution_renumbered_vectorized)
+  , values(other.values)
+  , unit_gradients(other.unit_gradients)
+  , gradients(other.gradients)
+  , dofs_per_component(other.dofs_per_component)
+  , component_in_base_element(other.component_in_base_element)
+  , nonzero_shape_function_component(other.nonzero_shape_function_component)
+  , update_flags(other.update_flags)
+  , fe_values(other.fe_values)
+  , mapping_info(other.mapping_info)
+  , current_cell_index(other.current_cell_index)
+  , current_face_number(other.current_face_number)
+  , fast_path(other.fast_path)
+  , is_reinitialized(false)
+  , shapes(other.shapes)
+{
+  mapping_info_on_the_fly.swap(other.mapping_info_on_the_fly);
+
+  connection_is_reinitialized = mapping_info->connect_is_reinitialized(
+    [this]() { this->is_reinitialized = false; });
+}
+
+
+
 template <int n_components, int dim, int spacedim, typename Number>
 FEPointEvaluation<n_components, dim, spacedim, Number>::~FEPointEvaluation()
 {
-- 
2.39.5