]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Create copy and assignment constructor
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Wed, 5 Apr 2023 10:53:27 +0000 (06:53 -0400)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Wed, 5 Apr 2023 10:53:34 +0000 (06:53 -0400)
include/deal.II/matrix_free/fe_point_evaluation.h

index 2cb90d108acfd274f75de1595c7afbe85305664f..b3c2c59f4ef2bc198ed82d99f4ce79680c2afdd1 100644 (file)
@@ -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()
 {

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.