From: Wolfgang Bangerth Date: Mon, 30 Oct 2017 22:33:17 +0000 (-0600) Subject: Make things work with complex-valued vectors. X-Git-Tag: v9.0.0-rc1~837^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af109f5ac38f9f5fe0d2093135eb7042c720da06;p=dealii.git Make things work with complex-valued vectors. --- diff --git a/source/numerics/error_estimator_1d.cc b/source/numerics/error_estimator_1d.cc index d49a71b914..d6482821cb 100644 --- a/source/numerics/error_estimator_1d.cc +++ b/source/numerics/error_estimator_1d.cc @@ -308,8 +308,8 @@ estimate (const Mapping<1,spacedim> &mapping, std::vector > >(2, std::vector >(n_components))); std::vector > > > gradients_neighbor (gradients_here); - std::vector > - grad_neighbor (n_solution_vectors, Vector(n_components)); + std::vector::type> > + grad_neighbor (n_solution_vectors, Vector::type>(n_components)); // reserve some space for coefficient values at one point. if there is no // coefficient, then we fill it by unity once and for all and don't set it @@ -436,12 +436,14 @@ estimate (const Mapping<1,spacedim> &mapping, if (component_mask[component] == true) { // get gradient here - const number grad_here = gradients_here[s][n][component] - * normal; - - const number jump = ((grad_here - grad_neighbor[s](component)) * - coefficient_values(component)); - (*errors[s])(cell->active_cell_index()) += numbers::NumberTraits::abs_square(jump) * cell->diameter(); + const typename ProductType::type + grad_here = gradients_here[s][n][component] * normal; + + const typename ProductType::type + jump = ((grad_here - grad_neighbor[s](component)) * + coefficient_values(component)); + (*errors[s])(cell->active_cell_index()) + += numbers::NumberTraits::type>::abs_square(jump) * cell->diameter(); } }