From cf7bbcca68087ca13d6cb706e24ce8eee59b5fbc Mon Sep 17 00:00:00 2001 From: kanschat Date: Mon, 29 Nov 2010 16:49:16 +0000 Subject: [PATCH] add normal fluxes and fix jump git-svn-id: https://svn.dealii.org/trunk@22875 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/integrators/differential.h | 110 ++++++++++++++++++ deal.II/include/deal.II/integrators/l2.h | 8 +- 2 files changed, 114 insertions(+), 4 deletions(-) diff --git a/deal.II/include/deal.II/integrators/differential.h b/deal.II/include/deal.II/integrators/differential.h index e9eac34ed8..0dfe89f491 100644 --- a/deal.II/include/deal.II/integrators/differential.h +++ b/deal.II/include/deal.II/integrators/differential.h @@ -185,6 +185,116 @@ namespace LocalIntegrators result(i) += ndx[d] * fetest.shape_value(i,k) * data[d][k]; } } +/** + * The trace of the divergence + * operator, namely the product + * of the jump of the normal component of the + * vector valued trial function and + * the mean value of the test function. + * @f[ + * \int_F (\mathbf u_1\cdot \mathbf n_1 + \mathbf u_2 \cdot \mathbf n_2) \frac{v_1+v_2}{2} \,ds + * @f] + */ + template + void + u_dot_n_matrix ( + FullMatrix& M11, + FullMatrix& M12, + FullMatrix& M21, + FullMatrix& M22, + const FEValuesBase& fe1, + const FEValuesBase& fe2, + const FEValuesBase& fetest1, + const FEValuesBase& fetest2, + double factor = 1.) + { + const unsigned int n_dofs = fe1.dofs_per_cell; + const unsigned int t_dofs = fetest1.dofs_per_cell; + + AssertDimension(fe1.get_fe().n_components(), dim); + AssertDimension(fe2.get_fe().n_components(), dim); + AssertDimension(fetest1.get_fe().n_components(), 1); + AssertDimension(fetest2.get_fe().n_components(), 1); + AssertDimension(M11.m(), t_dofs); + AssertDimension(M11.n(), n_dofs); + AssertDimension(M12.m(), t_dofs); + AssertDimension(M12.n(), n_dofs); + AssertDimension(M21.m(), t_dofs); + AssertDimension(M21.n(), n_dofs); + AssertDimension(M22.m(), t_dofs); + AssertDimension(M22.n(), n_dofs); + + for (unsigned k=0;k + void + u_dot_n_jump_matrix ( + FullMatrix& M11, + FullMatrix& M12, + FullMatrix& M21, + FullMatrix& M22, + const FEValuesBase& fe1, + const FEValuesBase& fe2, + double 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); + + for (unsigned k=0;k