From 156ebcbfd9bee6b55d3598f7f16b1d8b99a93602 Mon Sep 17 00:00:00 2001 From: kanschat Date: Wed, 4 Apr 2012 19:37:47 +0000 Subject: [PATCH] add matrix integrators git-svn-id: https://svn.dealii.org/trunk@25383 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/integrators/elasticity.h | 155 +++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/deal.II/include/deal.II/integrators/elasticity.h b/deal.II/include/deal.II/integrators/elasticity.h index e742d03101..69783504b6 100644 --- a/deal.II/include/deal.II/integrators/elasticity.h +++ b/deal.II/include/deal.II/integrators/elasticity.h @@ -34,10 +34,163 @@ namespace LocalIntegrators */ namespace Elasticity { +/** + * Scalar product of symmetric gradients. + * + * \f[ + * (\varepsilon(u), \varepsilon(v)) + * \f] + */ + template + inline void cell_matrix ( + FullMatrix& M, + const FEValuesBase& fe, + const 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 k=0;k + 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 k=0;k& n = fe.normal_vector(k); + for (unsigned i=0;i + inline void ip_matrix ( + FullMatrix& M11, + FullMatrix& M12, + FullMatrix& M21, + FullMatrix& M22, + const FEValuesBase& fe1, + const FEValuesBase& fe2, + const double pen, + const double int_factor = 1., + const double ext_factor = -1.) + { + const unsigned int n_dofs = fe1.dofs_per_cell; + + AssertDimension(fe1.get_fe().n_components(), dim); + AssertDimension(fe2.get_fe().n_components(), dim); + AssertDimension(M11.m(), n_dofs); + AssertDimension(M11.n(), n_dofs); + AssertDimension(M12.m(), n_dofs); + AssertDimension(M12.n(), n_dofs); + AssertDimension(M21.m(), n_dofs); + AssertDimension(M21.n(), n_dofs); + AssertDimension(M22.m(), n_dofs); + AssertDimension(M22.n(), n_dofs); + + const double nu1 = int_factor; + const double nu2 = (ext_factor < 0) ? int_factor : ext_factor; + const double penalty = .5 * pen * (nu1 + nu2); + + for (unsigned k=0;k& n = fe1.normal_vector(k); + for (unsigned i=0;i