]> https://gitweb.dealii.org/ - dealii.git/commitdiff
compute the norm of the divergence
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 23 Mar 2012 22:04:50 +0000 (22:04 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 23 Mar 2012 22:04:50 +0000 (22:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@25323 0785d39b-7218-0410-832d-ea1e28bc413d

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

index e8f7e953030cc02c72ae23ec09f685ef9468b39f..9ae0c14120eb8cefa5d37ba71eae8e5df13bf3f4 100644 (file)
@@ -366,6 +366,27 @@ namespace LocalIntegrators
                }
        }
     }
+
+    template <int dim>
+    double norm(const FEValuesBase<dim>& fe,
+               const VectorSlice<const std::vector<std::vector<Tensor<1,dim> > > >& Du)
+    {
+      unsigned int fecomp = fe.get_fe().n_components();
+      
+      AssertDimension(fecomp, dim);
+      AssertVectorVectorDimension (Du, dim, fe.n_quadrature_points);
+
+      double result = 0;
+      for (unsigned k=0;k<fe.n_quadrature_points;++k)
+       {
+         double div = Du[0][k][0];
+         for (unsigned int d=1;d<dim;++d)
+           div += Du[d][k][d];
+         result += div+div;
+       }
+      return result;
+    }
+
   }
 }
 

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.