From: Timo Heister Date: Tue, 2 Aug 2016 19:32:14 +0000 (+0200) Subject: deprecate functions, simplify code, cleanup X-Git-Tag: v8.5.0-rc1~789^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d48cc235ea9a5b6f0fb11d44547a8be087ad6c55;p=dealii.git deprecate functions, simplify code, cleanup - cleanup - update tests - deprecate some functions - simplify code --- diff --git a/include/deal.II/integrators/divergence.h b/include/deal.II/integrators/divergence.h index 3dedf483cb..791b671973 100644 --- a/include/deal.II/integrators/divergence.h +++ b/include/deal.II/integrators/divergence.h @@ -24,6 +24,7 @@ #include #include #include +#include DEAL_II_NAMESPACE_OPEN @@ -39,35 +40,6 @@ namespace LocalIntegrators */ namespace Divergence { - /** - * @deprecated Use LocalIntegrators::GradDiv:: - * Auxiliary function. Computes the grad-div-operator from a set of - * Hessians. - * - * @note The third tensor argument is not used in two dimensions and can - * for instance duplicate one of the previous. - * - * @author Guido Kanschat - * @date 2011 - */ - template - Tensor<1,dim> - grad_div( - const Tensor<2,dim> &h0, - const Tensor<2,dim> &h1, - const Tensor<2,dim> &h2) - { - Tensor<1,dim> result; - for (unsigned int d=0; d=2) result[d] += h1[d][1]; - if (dim >=3) result[d] += h2[d][2]; - } - return result; - } - - /** * Cell matrix for divergence. The derivative is on the trial function. * \f[ \int_Z v\nabla \cdot \mathbf u \,dx \f] This is the strong @@ -452,77 +424,41 @@ namespace LocalIntegrators } /** - * @deprecated Use LocalIntegrators::GradDiv::cell_matrix() - * instead. - * - * @author Guido Kanschat - * @date 2011 + * @deprecated Use LocalIntegrators::GradDiv::cell_matrix() instead. */ template void grad_div_matrix ( FullMatrix &M, const FEValuesBase &fe, - double factor = 1.) DEAL_II_DEPRECATED - { - const unsigned int n_dofs = fe.dofs_per_cell; - - AssertDimension(fe.get_fe().n_components(), dim); - AssertDimension(M.m(), n_dofs); - AssertDimension(M.n(), n_dofs); - - for (unsigned int k=0; k + void grad_div_matrix ( + FullMatrix &M, + const FEValuesBase &fe, + const double factor) + { + GradDiv::cell_matrix(M, fe, factor); } /** * @deprecated Use LocalIntegrators::GradDiv::cell_residual() instead. - * - * @author Guido Kanschat - * @date 2014 */ template void grad_div_residual ( Vector &result, const FEValuesBase &fetest, const VectorSlice > > > &input, - const double factor = 1.) DEAL_II_DEPRECATED - { - const unsigned int n_dofs = fetest.dofs_per_cell; - - AssertDimension(fetest.get_fe().n_components(), dim); - AssertVectorVectorDimension(input, dim, fetest.n_quadrature_points); - - for (unsigned int k=0; k + void grad_div_residual ( + Vector &result, + const FEValuesBase &fetest, + const VectorSlice > > > &input, + const double factor) + { + GradDiv::cell_residual(result, fetest, input, factor); } /** diff --git a/include/deal.II/integrators/grad_div.h b/include/deal.II/integrators/grad_div.h index 2b2fa9714e..58b8868fe8 100644 --- a/include/deal.II/integrators/grad_div.h +++ b/include/deal.II/integrators/grad_div.h @@ -39,33 +39,6 @@ namespace LocalIntegrators */ namespace GradDiv { - /** - * Auxiliary function. Computes the grad-div-operator from a set of - * Hessians. - * - * @note The third tensor argument is not used in two dimensions and can - * for instance duplicate one of the previous. - * - * @author Guido Kanschat - * @date 2011 - */ - template - Tensor<1,dim> - grad_div( - const Tensor<2,dim> &h0, - const Tensor<2,dim> &h1, - const Tensor<2,dim> &h2) - { - Tensor<1,dim> result; - for (unsigned int d=0; d=2) result[d] += h1[d][1]; - if (dim >=3) result[d] += h2[d][2]; - } - return result; - } - /** * The weak form of the grad-div operator penalizing volume changes * @f[ @@ -93,15 +66,10 @@ namespace LocalIntegrators for (unsigned int i=0; i n = fe.normal_vector(k); - - double umgn = 0.; - double divu = 0.; - for (unsigned int d=0; d n = fe1.normal_vector(k); for (unsigned int i=0; i n = fe1.normal_vector(k); - double uni = 0.; - double une = 0.; - double divui = 0.; - double divue = 0.; - for (unsigned int d=0; d #include +#include #include #include #include @@ -77,7 +78,7 @@ void cell_matrix( { ++de; L2::mass_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de)); - Divergence::grad_div_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de)); + GradDiv::cell_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de)); Divergence::cell_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de), info.fe_values(de+1)); } diff --git a/tests/integrators/grad_div_01.cc b/tests/integrators/grad_div_01.cc index 2bcc6db40b..23773a42b1 100644 --- a/tests/integrators/grad_div_01.cc +++ b/tests/integrators/grad_div_01.cc @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -// Test the functions in integrators/elasticity.h +// Test the functions in integrators/grad_div.h // Output matrices and assert consistency of residuals #include "../tests.h"