]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Windows porting: Minor refactoring to make MSVC happy 1270/head
authorMatthias Maier <tamiko@43-1.org>
Wed, 5 Aug 2015 22:12:04 +0000 (17:12 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 6 Aug 2015 03:58:48 +0000 (22:58 -0500)
Those are minor code changes necessary to compile the library with MSVC.

include/deal.II/base/numbers.h
include/deal.II/base/quadrature_lib.h
include/deal.II/numerics/error_estimator.h
source/base/quadrature_lib.cc
source/numerics/error_estimator.cc

index 70ce3cdb58e1d96aff5550a51c15755ce3323340..fe06328e917fa6b3ff40142fb9656c5a0896c19a 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <deal.II/base/config.h>
 #include <deal.II/base/types.h>
+
+#include <cmath>
 #include <complex>
 
 DEAL_II_NAMESPACE_OPEN
@@ -318,7 +320,7 @@ namespace numbers
   typename NumberTraits<number>::real_type
   NumberTraits<number>::abs (const number &x)
   {
-    return std::fabs(x);
+    return std::abs(x);
   }
 
 
index 82df8966f19ad53ea9c0d0dfa6cb1bcd60f60ff3..db25354b60f13563690d63cb2d416ac1598e0279 100644 (file)
@@ -571,7 +571,7 @@ public:
   enum EndPoint { left,right };
   /// Generate a formula with <tt>n</tt> quadrature points
   QGaussRadauChebyshev(const unsigned int n,
-                       QGaussRadauChebyshev::EndPoint ep=QGaussRadauChebyshev::left);
+                       EndPoint ep=QGaussRadauChebyshev::left);
 
 private:
   const EndPoint ep;
index ef55c85b2bc76ffad8305e216420ad7ca2920b98..d79b29e80babb1bc5baa8b2c82dd71046a75de38 100644 (file)
@@ -337,7 +337,7 @@ public:
                         const unsigned int       n_threads = numbers::invalid_unsigned_int,
                         const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
                         const types::material_id       material_id = numbers::invalid_material_id,
-                        const KellyErrorEstimator<dim,spacedim>::Strategy strategy = cell_diameter_over_24);
+                        const Strategy strategy = cell_diameter_over_24);
 
   /**
    * Calls the @p estimate function, see above, with
@@ -354,7 +354,7 @@ public:
                         const unsigned int       n_threads = numbers::invalid_unsigned_int,
                         const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
                         const types::material_id       material_id = numbers::invalid_material_id,
-                        const KellyErrorEstimator<dim,spacedim>::Strategy strategy = cell_diameter_over_24);
+                        const Strategy strategy = cell_diameter_over_24);
 
   /**
    * Same function as above, but accepts more than one solution vector and
@@ -381,7 +381,7 @@ public:
                         const unsigned int           n_threads = numbers::invalid_unsigned_int,
                         const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
                         const types::material_id           material_id = numbers::invalid_material_id,
-                        const KellyErrorEstimator<dim,spacedim>::Strategy strategy = cell_diameter_over_24);
+                        const Strategy strategy = cell_diameter_over_24);
 
   /**
    * Calls the @p estimate function, see above, with
@@ -398,7 +398,7 @@ public:
                         const unsigned int           n_threads = numbers::invalid_unsigned_int,
                         const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
                         const types::material_id          material_id = numbers::invalid_material_id,
-                        const KellyErrorEstimator<dim,spacedim>::Strategy strategy = cell_diameter_over_24);
+                        const Strategy strategy = cell_diameter_over_24);
 
 
   /**
@@ -417,7 +417,7 @@ public:
                         const unsigned int       n_threads = numbers::invalid_unsigned_int,
                         const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
                         const types::material_id       material_id = numbers::invalid_material_id,
-                        const KellyErrorEstimator<dim,spacedim>::Strategy strategy = cell_diameter_over_24);
+                        const Strategy strategy = cell_diameter_over_24);
 
 
   /**
@@ -435,7 +435,7 @@ public:
                         const unsigned int       n_threads = numbers::invalid_unsigned_int,
                         const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
                         const types::material_id       material_id = numbers::invalid_material_id,
-                        const KellyErrorEstimator<dim,spacedim>::Strategy strategy = cell_diameter_over_24);
+                        const Strategy strategy = cell_diameter_over_24);
 
 
   /**
@@ -454,7 +454,7 @@ public:
                         const unsigned int           n_threads = numbers::invalid_unsigned_int,
                         const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
                         const types::material_id           material_id = numbers::invalid_material_id,
-                        const KellyErrorEstimator<dim,spacedim>::Strategy strategy = cell_diameter_over_24);
+                        const Strategy strategy = cell_diameter_over_24);
 
 
   /**
@@ -472,7 +472,7 @@ public:
                         const unsigned int           n_threads = numbers::invalid_unsigned_int,
                         const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
                         const types::material_id           material_id = numbers::invalid_material_id,
-                        const KellyErrorEstimator<dim,spacedim>::Strategy strategy = cell_diameter_over_24);
+                        const Strategy strategy = cell_diameter_over_24);
 
   /**
    * Exception
index a25dafe3651eee4cdab82c6e371039efd6be0e4b..3eead3a7eab652dfcc5a8c05bad5a61db2214949 100644 (file)
@@ -1201,7 +1201,7 @@ QGaussChebyshev<dim>::QGaussChebyshev (const unsigned int n)
 template <>
 std::vector<double>
 QGaussRadauChebyshev<1>::get_quadrature_points(const unsigned int n,
-                                               QGaussRadauChebyshev::EndPoint ep)
+                                               EndPoint ep)
 {
 
   std::vector<double> points(n);
@@ -1225,7 +1225,7 @@ QGaussRadauChebyshev<1>::get_quadrature_points(const unsigned int n,
 template <>
 std::vector<double>
 QGaussRadauChebyshev<1>::get_quadrature_weights(const unsigned int n,
-                                                QGaussRadauChebyshev::EndPoint ep)
+                                                EndPoint ep)
 {
 
   std::vector<double> weights(n);
@@ -1267,7 +1267,7 @@ QGaussRadauChebyshev<1>::QGaussRadauChebyshev(const unsigned int n,
 
 template <>
 QGaussRadauChebyshev<2>::QGaussRadauChebyshev (const unsigned int n,
-                                               QGaussRadauChebyshev::EndPoint ep)
+                                               EndPoint ep)
   :
   Quadrature<2> (QGaussRadauChebyshev<1>(n, static_cast<QGaussRadauChebyshev<1>::EndPoint>(ep)),
                  QGaussRadauChebyshev<1>(n, static_cast<QGaussRadauChebyshev<1>::EndPoint>(ep))),
@@ -1277,7 +1277,7 @@ QGaussRadauChebyshev<2>::QGaussRadauChebyshev (const unsigned int n,
 
 template <int dim>
 QGaussRadauChebyshev<dim>::QGaussRadauChebyshev (const unsigned int n,
-                                                 QGaussRadauChebyshev::EndPoint ep)
+                                                 EndPoint ep)
   :
   Quadrature<dim> (QGaussRadauChebyshev<dim-1>(n,static_cast<typename QGaussRadauChebyshev<dim-1>::EndPoint>(ep)),
                    QGaussRadauChebyshev<1>(n,static_cast<QGaussRadauChebyshev<1>::EndPoint>(ep))),
index cad9799838963b9446d739c451c254bc160d995f..ae49a61dce4568fd3f44f2b0925b9a2deff0e16d 100644 (file)
@@ -954,7 +954,7 @@ estimate (const Mapping<dim, spacedim>      &mapping,
           const unsigned int       n_threads,
           const types::subdomain_id subdomain_id,
           const types::material_id       material_id,
-          const typename KellyErrorEstimator<dim,spacedim>::Strategy strategy)
+          const Strategy strategy)
 {
   // just pass on to the other function
   const std::vector<const InputVector *> solutions (1, &solution);
@@ -978,7 +978,7 @@ estimate (const DH                &dof_handler,
           const unsigned int       n_threads,
           const types::subdomain_id subdomain_id,
           const types::material_id       material_id,
-          const typename KellyErrorEstimator<dim,spacedim>::Strategy strategy)
+          const Strategy strategy)
 {
   estimate(StaticMappingQ1<dim,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
            error, component_mask, coefficients, n_threads,
@@ -1001,7 +1001,7 @@ estimate (const Mapping<dim, spacedim>      &mapping,
           const unsigned int       n_threads,
           const types::subdomain_id subdomain_id,
           const types::material_id       material_id,
-          const typename KellyErrorEstimator<dim,spacedim>::Strategy strategy)
+          const Strategy strategy)
 {
   // just pass on to the other function
   const std::vector<const InputVector *> solutions (1, &solution);
@@ -1025,7 +1025,7 @@ estimate (const DH                &dof_handler,
           const unsigned int       n_threads,
           const types::subdomain_id subdomain_id,
           const types::material_id       material_id,
-          const typename KellyErrorEstimator<dim,spacedim>::Strategy strategy)
+          const Strategy strategy)
 {
   estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
            error, component_mask, coefficients, n_threads,
@@ -1050,7 +1050,7 @@ estimate (const Mapping<dim, spacedim>                  &mapping,
           const unsigned int                   ,
           const types::subdomain_id          subdomain_id_,
           const types::material_id                   material_id,
-          const typename KellyErrorEstimator<dim,spacedim>::Strategy strategy)
+          const Strategy strategy)
 {
 #ifdef DEAL_II_WITH_P4EST
   if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
@@ -1214,7 +1214,7 @@ estimate (const Mapping<dim, spacedim>                  &mapping,
           const unsigned int                   n_threads,
           const types::subdomain_id          subdomain_id,
           const types::material_id                   material_id,
-          const typename KellyErrorEstimator<dim,spacedim>::Strategy strategy)
+          const Strategy strategy)
 {
   // forward to the function with the QCollection
   estimate (mapping, dof_handler,
@@ -1237,7 +1237,7 @@ void KellyErrorEstimator<dim, spacedim>::estimate (const DH
                                                    const unsigned int                   n_threads,
                                                    const types::subdomain_id subdomain_id,
                                                    const types::material_id       material_id,
-                                                   const typename KellyErrorEstimator<dim,spacedim>::Strategy strategy)
+                                                   const Strategy strategy)
 {
   estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
            errors, component_mask, coefficients, n_threads,
@@ -1258,7 +1258,7 @@ void KellyErrorEstimator<dim, spacedim>::estimate (const DH
                                                    const unsigned int                   n_threads,
                                                    const types::subdomain_id subdomain_id,
                                                    const types::material_id       material_id,
-                                                   const typename KellyErrorEstimator<dim,spacedim>::Strategy strategy)
+                                                   const Strategy strategy)
 {
   estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
            errors, component_mask, coefficients, n_threads,

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.