]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
support long double
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Mar 2013 14:56:33 +0000 (14:56 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Mar 2013 14:56:33 +0000 (14:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@28931 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/integrators/divergence.h
deal.II/include/deal.II/integrators/elasticity.h
deal.II/include/deal.II/integrators/l2.h
deal.II/include/deal.II/integrators/laplace.h
deal.II/include/deal.II/meshworker/dof_info.h
deal.II/include/deal.II/meshworker/integration_info.h

index 56b6baff081b9f4f0b9f1b7d8c0b132be5a998db..8982d4a7ed67ff804f9bf50b05c1e7c228ed49f6 100644 (file)
@@ -121,9 +121,9 @@ namespace LocalIntegrators
      * @author Guido Kanschat
      * @date 2011
      */
-    template <int dim>
+    template <int dim, typename number=double>
     void cell_residual(
-      Vector<double> &result,
+      Vector<number> &result,
       const FEValuesBase<dim> &fetest,
       const VectorSlice<const std::vector<std::vector<Tensor<1,dim> > > > &input,
       const double factor = 1.)
@@ -201,9 +201,9 @@ namespace LocalIntegrators
      * @author Guido Kanschat
      * @date 2011
      */
-    template <int dim>
+    template <int dim, typename number=double>
     void gradient_residual(
-      Vector<double> &result,
+      Vector<number> &result,
       const FEValuesBase<dim> &fetest,
       const std::vector<Tensor<1,dim> > &input,
       const double factor = 1.)
@@ -273,10 +273,10 @@ namespace LocalIntegrators
      * @author Guido Kanschat
      * @date 2011
      */
-    template<int dim>
+    template<int dim, typename number=double>
     void
     u_dot_n_residual (
-      Vector<double> &result,
+      Vector<number> &result,
       const FEValuesBase<dim> &fe,
       const FEValuesBase<dim> &fetest,
       const VectorSlice<const std::vector<std::vector<double> > > &data,
index 8fe0766f8bd8aebfae4a17be733386cbc6fb8f35..39c6220744bcab008ad07122c01ad97c74d0fbc0 100644 (file)
@@ -75,10 +75,10 @@ namespace LocalIntegrators
      * - \int_Z \varepsilon(u): \varepsilon(v) \,dx
      * \f]
      */
-    template <int dim>
+    template <int dim, typename number=double>
     inline void
     cell_residual  (
-      Vector<double> &result,
+      Vector<number> &result,
       const FEValuesBase<dim> &fe,
       const VectorSlice<const std::vector<std::vector<Tensor<1,dim> > > > &input,
       double factor = 1.)
@@ -167,9 +167,9 @@ namespace LocalIntegrators
      * @author Guido Kanschat
      * @date 2013
      */
-    template <int dim>
+    template <int dim, typename number=double>
     void nitsche_residual (
-      Vector<double> &result,
+      Vector<number> &result,
       const FEValuesBase<dim> &fe,
       const VectorSlice<const std::vector<std::vector<double> > > &input,
       const VectorSlice<const std::vector<std::vector<Tensor<1,dim> > > > &Dinput,
@@ -292,11 +292,11 @@ namespace LocalIntegrators
      * @author Guido Kanschat
      * @date 2013
      */
-    template<int dim>
+    template<int dim, typename number=double>
     void
     ip_residual(
-      Vector<double> &result1,
-      Vector<double> &result2,
+      Vector<number> &result1,
+      Vector<number> &result2,
       const FEValuesBase<dim> &fe1,
       const FEValuesBase<dim> &fe2,
       const VectorSlice<const std::vector<std::vector<double> > > &input1,
index 9f5a304f8b6c6ae91b99164436f97a18eba49a64..a6b6536639a7288891cd8dc6e5c7ffc18905c2b7 100644 (file)
@@ -80,9 +80,9 @@ namespace LocalIntegrators
      * @author Guido Kanschat
      * @date 2008, 2009, 2010
      */
-    template <int dim>
+    template <int dim, typename number=double>
     void L2 (
-      Vector<double> &result,
+      Vector<number> &result,
       const FEValuesBase<dim> &fe,
       const std::vector<double> &input,
       const double factor = 1.)
@@ -109,9 +109,9 @@ namespace LocalIntegrators
      * @author Guido Kanschat
      * @date 2008, 2009, 2010
      */
-    template <int dim>
+    template <int dim, typename number=double>
     void L2 (
-      Vector<double> &result,
+      Vector<number> &result,
       const FEValuesBase<dim> &fe,
       const VectorSlice<const std::vector<std::vector<double> > > &input,
       const double factor = 1.)
index 7a0c003eba2a4dbe8dd581cbd0dbe6d3de6854ff..272e8d2c9d566eba9605f650f2ea364df111e586 100644 (file)
@@ -486,10 +486,10 @@ namespace LocalIntegrators
      * @author Guido Kanschat
      * @date 2010
      */
-    template <int dim>
+    template <int dim, int spacedim=dim, typename number>
     double compute_penalty(
-      const MeshWorker::DoFInfo<dim> &dinfo1,
-      const MeshWorker::DoFInfo<dim> &dinfo2,
+      const MeshWorker::DoFInfo<dim,spacedim,number> &dinfo1,
+      const MeshWorker::DoFInfo<dim,spacedim,number> &dinfo2,
       unsigned int deg1,
       unsigned int deg2)
     {
index 46116bd4e2aeb8d7102d6790716d47dd36ea49eb..cc12fedd04c0151973f228763d68b995de2a0d4f 100644 (file)
@@ -117,8 +117,7 @@ namespace MeshWorker
      * pointer empty, but setting
      * the #aux_local_indices.
      */
-    template <class DH>
-    DoFInfo (const DH &dof_handler);
+    DoFInfo (const DoFHandler<dim, spacedim>& dof_handler);
 
     /**
      * Set the current cell and
@@ -281,8 +280,7 @@ namespace MeshWorker
 //----------------------------------------------------------------------//
 
   template <int dim, int spacedim, typename number>
-  template <class DH>
-  DoFInfo<dim,spacedim,number>::DoFInfo(const DH &dof_handler)
+  DoFInfo<dim,spacedim,number>::DoFInfo(const DoFHandler<dim,spacedim> &dof_handler)
   {
     std::vector<unsigned int> aux(1);
     aux[0] = dof_handler.get_fe().dofs_per_cell;
index a57459f2dbf81e965e8f0581dedd9bc2291c3ff1..dbea00f0e1281f028850e183ac57bed5ac667ca5 100644 (file)
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -220,7 +220,8 @@ namespace MeshWorker
      * Reinitialize internal data
      * structures for use on a cell.
      */
-    void reinit(const DoFInfo<dim, spacedim> &i);
+    template <typename number=double>
+    void reinit(const DoFInfo<dim, spacedim, number> &i);
 
     /**
      * Use the finite element
@@ -887,8 +888,9 @@ namespace MeshWorker
 
 
   template <int dim, int spacedim>
+  template <typename number>
   inline void
-  IntegrationInfo<dim,spacedim>::reinit(const DoFInfo<dim, spacedim> &info)
+  IntegrationInfo<dim,spacedim>::reinit(const DoFInfo<dim, spacedim, number> &info)
   {
     for (unsigned int i=0; i<fevalv.size(); ++i)
       {
@@ -920,8 +922,9 @@ namespace MeshWorker
 
 
   template <>
+  template <typename number>
   inline void
-  IntegrationInfo<1,1>::reinit(const DoFInfo<1,1> &info)
+  IntegrationInfo<1,1>::reinit(const DoFInfo<1,1,number> &info)
   {
     const int dim = 1;
     const int spacedim = 1;
@@ -954,8 +957,9 @@ namespace MeshWorker
 
 
   template <>
+  template <typename number>
   inline void
-  IntegrationInfo<1,2>::reinit(const DoFInfo<1,2> &info)
+  IntegrationInfo<1,2>::reinit(const DoFInfo<1,2,number> &info)
   {
     const int dim = 1;
     const int spacedim = 2;

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.