From 252aa54b0f99b510bac18db1fd76b897c41976d4 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 2 Aug 2016 17:30:47 +0200 Subject: [PATCH] add divergence integrators --- include/deal.II/integrators/divergence.h | 108 +++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/include/deal.II/integrators/divergence.h b/include/deal.II/integrators/divergence.h index 4bd9c90eb7..fcbc72811b 100644 --- a/include/deal.II/integrators/divergence.h +++ b/include/deal.II/integrators/divergence.h @@ -529,6 +529,114 @@ namespace LocalIntegrators } } + /** + * The matrix for the weak boundary condition of Nitsche type for linear elasticity: + * @f[ + * \int_F \Bigl(\gamma (u \cdot n)(v \cdot n) - \nabla\cdot u + * v\cdot n - u \cdot n \nabla \cdot v \Bigr)\;ds. + * @f] + */ + template + inline void nitsche_matrix ( + FullMatrix &M, + const FEValuesBase &fe, + double penalty, + double factor = 1.) + { + 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 n = fe.normal_vector(k); + for (unsigned int i=0; i + void ip_matrix ( + FullMatrix &M11, + FullMatrix &M12, + FullMatrix &M21, + FullMatrix &M22, + const FEValuesBase &fe1, + const FEValuesBase &fe2, + double penalty, + double factor1 = 1., + double factor2 = -1.) + { + const unsigned int n_dofs = fe1.dofs_per_cell; + AssertDimension(M11.n(), n_dofs); + AssertDimension(M11.m(), n_dofs); + AssertDimension(M12.n(), n_dofs); + AssertDimension(M12.m(), n_dofs); + AssertDimension(M21.n(), n_dofs); + AssertDimension(M21.m(), n_dofs); + AssertDimension(M22.n(), n_dofs); + AssertDimension(M22.m(), n_dofs); + + const double nui = factor1; + const double nue = (factor2 < 0) ? factor1 : factor2; + const double nu = .5*(nui+nue); + + for (unsigned int k=0; k n = fe1.normal_vector(k); + for (unsigned int i=0; i