From: Martin Kronbichler Date: Mon, 7 Nov 2016 10:52:20 +0000 (+0100) Subject: Avoid warning about missing copy constructor X-Git-Tag: v8.5.0-rc1~445^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a888916a9e44e7aa065abb2f57c94f951f3eb303;p=dealii.git Avoid warning about missing copy constructor --- diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index d90cc5a220..cf88f73523 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -649,6 +649,14 @@ protected: */ FEEvaluationBase (const FEEvaluationBase &other); + /** + * Copy assignment operator. If FEEvaluationBase was constructed from a + * mapping, fe, quadrature, and update flags, the underlying geometry + * evaluation based on FEValues will be deep-copied in order to allow for + * using in parallel with threads. + */ + FEEvaluationBase &operator = (const FEEvaluationBase &other); + /** * A unified function to read from and write into vectors based on the given * template operation. It can perform the operation for @p read_dof_values, @@ -950,6 +958,11 @@ protected: * Copy constructor */ FEEvaluationAccess (const FEEvaluationAccess &other); + + /** + * Copy assignment operator + */ + FEEvaluationAccess &operator= (const FEEvaluationAccess &other); }; @@ -1089,6 +1102,11 @@ protected: * Copy constructor */ FEEvaluationAccess (const FEEvaluationAccess &other); + + /** + * Copy assignment operator + */ + FEEvaluationAccess &operator= (const FEEvaluationAccess &other); }; @@ -1237,6 +1255,11 @@ protected: * Copy constructor */ FEEvaluationAccess (const FEEvaluationAccess &other); + + /** + * Copy assignment operator + */ + FEEvaluationAccess &operator= (const FEEvaluationAccess &other); }; @@ -1375,6 +1398,11 @@ protected: * Copy constructor */ FEEvaluationAccess (const FEEvaluationAccess &other); + + /** + * Copy assignment operator + */ + FEEvaluationAccess &operator= (const FEEvaluationAccess &other); }; @@ -1887,6 +1915,14 @@ public: */ FEEvaluation (const FEEvaluation &other); + /** + * Copy assignment operator. If FEEvaluationBase was constructed from a + * mapping, fe, quadrature, and update flags, the underlying geometry + * evaluation based on FEValues will be deep-copied in order to allow for + * using in parallel with threads. + */ + FEEvaluation &operator= (const FEEvaluation &other); + /** * Evaluates the function values, the gradients, and the Laplacians of the * FE function given at the DoF values in the input vector at the quadrature @@ -2029,7 +2065,13 @@ FEEvaluationBase cell (numbers::invalid_unsigned_int), cell_type (internal::MatrixFreeFunctions::undefined), cell_data_number (numbers::invalid_unsigned_int), - first_selected_component (0) + dof_values_initialized (false), + values_quad_initialized (false), + gradients_quad_initialized(false), + hessians_quad_initialized (false), + values_quad_submitted (false), + gradients_quad_submitted (false), + first_selected_component (0) { for (unsigned int c=0; c cell (0), cell_type (internal::MatrixFreeFunctions::general), cell_data_number (numbers::invalid_unsigned_int), + dof_values_initialized (false), + values_quad_initialized (false), + gradients_quad_initialized(false), + hessians_quad_initialized (false), + values_quad_submitted (false), + gradients_quad_submitted (false), // keep the number of the selected component within the current base element // for reading dof values - first_selected_component (fe.component_to_base_index(first_selected_component).second) + first_selected_component (fe.component_to_base_index(first_selected_component).second) { const unsigned int base_element_number = fe.component_to_base_index(first_selected_component).first; @@ -2157,7 +2205,13 @@ FEEvaluationBase cell (numbers::invalid_unsigned_int), cell_type (internal::MatrixFreeFunctions::general), cell_data_number (numbers::invalid_unsigned_int), - first_selected_component (other.first_selected_component) + dof_values_initialized (false), + values_quad_initialized (false), + gradients_quad_initialized(false), + hessians_quad_initialized (false), + values_quad_submitted (false), + gradients_quad_submitted (false), + first_selected_component (other.first_selected_component) { for (unsigned int c=0; c +template +inline +FEEvaluationBase & +FEEvaluationBase +::operator= (const FEEvaluationBase &other) +{ + AssertDimension(quad_no, other.quad_no); + AssertDimension(n_fe_components, other.n_fe_components); + AssertDimension(active_fe_index, other.active_fe_index); + AssertDimension(active_quad_index, other.active_quad_index); + AssertDimension(first_selected_component, other.first_selected_component); + + matrix_info = other.matrix_info; + dof_info = other.dof_info; + mapping_info = other.mapping_info; + stored_shape_info = other.stored_shape_info; + data = other.data; + cartesian_data = 0; + jacobian = 0; + J_value = 0; + quadrature_weights = mapping_info != 0 ? + mapping_info->mapping_data_gen[quad_no]. + quadrature_weights[active_quad_index].begin() + : + 0; + quadrature_points = 0; + jacobian_grad = 0; + jacobian_grad_upper = 0; + cell = numbers::invalid_unsigned_int; + cell_type = internal::MatrixFreeFunctions::general; + cell_data_number = numbers::invalid_unsigned_int; + + // Create deep copy of mapped geometry for use in parallel... + if (other.mapped_geometry.get() != 0) + { + mapped_geometry.reset + (new internal::MatrixFreeFunctions:: + MappingDataOnTheFly(other.mapped_geometry->get_fe_values().get_mapping(), + other.mapped_geometry->get_quadrature(), + other.mapped_geometry->get_fe_values().get_update_flags())); + jacobian = mapped_geometry->get_inverse_jacobians().begin(); + J_value = mapped_geometry->get_JxW_values().begin(); + quadrature_points = mapped_geometry->get_quadrature_points().begin(); + cell = 0; + } + + return *this; +} + + + template inline void @@ -4026,6 +4131,17 @@ FEEvaluationAccess +template +inline +FEEvaluationAccess & +FEEvaluationAccess +::operator= (const FEEvaluationAccess &other) +{ + this->FEEvaluationBase::operator=(other); + return *this; +} + + /*-------------------- FEEvaluationAccess scalar ----------------------------*/ @@ -4072,6 +4188,18 @@ FEEvaluationAccess +template +inline +FEEvaluationAccess & +FEEvaluationAccess +::operator= (const FEEvaluationAccess &other) +{ + this->FEEvaluationBase::operator=(other); + return *this; +} + + + template inline VectorizedArray @@ -4311,6 +4439,18 @@ FEEvaluationAccess +template +inline +FEEvaluationAccess & +FEEvaluationAccess +::operator= (const FEEvaluationAccess &other) +{ + this->FEEvaluationAccess::operator=(other); + return *this; +} + + + template inline Tensor<2,dim,VectorizedArray > @@ -4671,6 +4811,18 @@ FEEvaluationAccess<1,1,Number> +template +inline +FEEvaluationAccess<1,1,Number> & +FEEvaluationAccess<1,1,Number> +::operator= (const FEEvaluationAccess<1,1,Number> &other) +{ + this->FEEvaluationBase<1,1,Number>::operator=(other); + return *this; +} + + + template inline VectorizedArray @@ -6728,6 +6880,20 @@ FEEvaluation +template +inline +FEEvaluation & +FEEvaluation +::operator= (const FEEvaluation &other) +{ + this->FEEvaluationAccess::operator=(other); + set_data_pointers(); + return *this; +} + + + template inline