From: Rene Gassmoeller Date: Wed, 5 Apr 2023 10:53:27 +0000 (-0400) Subject: Create copy and assignment constructor X-Git-Tag: v9.5.0-rc1~364^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e4f9662a884c9673eadb0408ecd2d156f7b11a4;p=dealii.git Create copy and assignment constructor --- 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 & fe, const unsigned int first_selected_component = 0); + /** + * Copy constructor. + */ + FEPointEvaluation(FEPointEvaluation &other); + + /** + * Move constructor. + */ + FEPointEvaluation(FEPointEvaluation &&other); + /** * Destructor. */ @@ -861,6 +871,76 @@ FEPointEvaluation::FEPointEvaluation( +template +FEPointEvaluation::FEPointEvaluation( + FEPointEvaluation &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(*mapping, + update_flags)); + + connection_is_reinitialized = mapping_info->connect_is_reinitialized( + [this]() { this->is_reinitialized = false; }); +} + + + +template +FEPointEvaluation::FEPointEvaluation( + FEPointEvaluation &&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 FEPointEvaluation::~FEPointEvaluation() {