From 78b8946af4f51f10249be7d58d4bf16a83284a4d Mon Sep 17 00:00:00 2001 From: kanschat Date: Sun, 14 Nov 2010 22:29:29 +0000 Subject: [PATCH] add scalar version of Nitsche boundary residual git-svn-id: https://svn.dealii.org/trunk@22723 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/integrators/laplace.h | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/deal.II/include/deal.II/integrators/laplace.h b/deal.II/include/deal.II/integrators/laplace.h index 9d213be76d..47ed06e1dc 100644 --- a/deal.II/include/deal.II/integrators/laplace.h +++ b/deal.II/include/deal.II/integrators/laplace.h @@ -109,7 +109,8 @@ namespace LocalIntegrators } /** - * Weak boundary condition for the Laplace operator by Nitsche, namely on the face F + * Weak boundary condition for the Laplace operator by Nitsche, vector + * valued version, namely on the face F * the vector * @f[ * \int_F \Bigl(\gamma (u-g) v - \partial_n u v - (u-g) \partial_n v\Bigr)\;ds. @@ -156,6 +157,51 @@ namespace LocalIntegrators } } +/** + * Weak boundary condition for the Laplace operator by Nitsche, scalar + * version, namely on the face F the vector + * @f[ + * \int_F \Bigl(\gamma (u-g) v - \partial_n u v - (u-g) \partial_n v\Bigr)\;ds. + * @f] + * + * Here, u is the finite element function whose values and + * gradient are given in the arguments input and + * Dinput, respectively. g is the inhomogeneous + * boundary value in the argument data. $\gamma$ is the usual + * penalty parameter. + */ + template + void nitsche_residual ( + Vector& result, + const FEValuesBase& fe, + const std::vector& input, + const std::vector >& Dinput, + const std::vector& data, + double penalty, + double factor = 1.) + { + const unsigned int n_dofs = fe.dofs_per_cell; + AssertDimension(input.size(), fe.n_quadrature_points); + AssertDimension(Dinput.size(), fe.n_quadrature_points); + AssertDimension(data.size(), fe.n_quadrature_points); + + for (unsigned k=0;k& n = fe.normal_vector(k); + for (unsigned i=0;iF the matrices associated with the bilinear form -- 2.39.5