]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
move grad_div to Divergence
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 29 Nov 2010 17:17:26 +0000 (17:17 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 29 Nov 2010 17:17:26 +0000 (17:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@22880 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/integrators/divergence.h
deal.II/include/deal.II/integrators/elasticity.h

index 23ab7dbaf9683c68e7c1e6b90f793d8b062ea9ea..57145b923caf7d5c44f9c5fa55cf4fc385a3312b 100644 (file)
@@ -243,6 +243,43 @@ namespace LocalIntegrators
        }
     }
 
+/**
+ * The weak form of the grad-div operator penalizing volume changes
+ * @f[
+ *  \int_Z \nabla\!\cdot\!u \nabla\!\cdot\!v \,dx
+ * @f]
+ */
+    template <int dim>
+    void grad_div_matrix (
+      FullMatrix<double>& M,
+      const FEValuesBase<dim>& fe,
+      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<fe.n_quadrature_points;++k)
+       {
+         const double dx = factor * fe.JxW(k);
+         for (unsigned i=0;i<n_dofs;++i)
+           for (unsigned j=0;j<n_dofs;++j)
+             {
+               double dv = 0.;
+               double du = 0.;
+               for (unsigned int d=0;d<dim;++d)
+                 {
+                   dv += fe.shape_grad_component(i,k,d)[d];
+                   du += fe.shape_grad_component(j,k,d)[d];
+                 }
+               
+               M(i,j) += dx * du * dv;
+             }
+       }
+    }
+
 /**
  * The jump of the normal component
  * @f[
index ef46c0d8e2fd0c29cd594c6a537e079687dce11f..4a893671fc2164a6935f9767d2a2f6c62ca00910 100644 (file)
@@ -34,44 +34,6 @@ namespace LocalIntegrators
  */
   namespace Elasticity
   {
-                                    /**
-                                     * The weak form of the grad-div
-                                     * operator penalizing volume changes
-                                     * @f[
-                                     * \int_Z \nabla\!\cdot\!u
-                                     * \nabla\!\cdot\!v \,dx
-                                     * @f]
-                                     */
-    template <int dim>
-    void grad_div_matrix (
-      FullMatrix<double>& M,
-      const FEValuesBase<dim>& fe,
-      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<fe.n_quadrature_points;++k)
-       {
-         const double dx = factor * fe.JxW(k);
-         for (unsigned i=0;i<n_dofs;++i)
-           for (unsigned j=0;j<n_dofs;++j)
-             {
-               double dv = 0.;
-               double du = 0.;
-               for (unsigned int d=0;d<dim;++d)
-                 {
-                   dv += fe.shape_grad_component(i,k,d)[d];
-                   du += fe.shape_grad_component(j,k,d)[d];
-                 }
-               
-               M(i,j) += dx * du * dv;
-             }
-       }
-    }
   }
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.