]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some warnings and errors reported by MSVC 5907/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 15 Feb 2018 00:50:01 +0000 (01:50 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 16 Feb 2018 00:36:03 +0000 (01:36 +0100)
include/deal.II/base/parameter_acceptor.h
include/deal.II/grid/grid_tools.h
include/deal.II/multigrid/multigrid.h
include/deal.II/numerics/vector_tools.templates.h
source/distributed/tria_base.cc
source/fe/fe_values.cc
source/grid/manifold.cc

index 4e6c22ebf077831ff2f256f80df4515251461bad..83e6c8845f4906e5c71c9f46ff46a67b8d4c5bea 100644 (file)
@@ -474,7 +474,7 @@ public:
   void add_parameter(const std::string &entry,
                      ParameterType &parameter,
                      const std::string &documentation = std::string(),
-                     ParameterHandler &prm = ParameterAcceptor::prm,
+                     ParameterHandler &prm_ = prm,
                      const Patterns::PatternBase &pattern =
                        *Patterns::Tools::Convert<ParameterType>::to_pattern());
 
index 0cd6071e5774d063e8a61933afadd450189fec2e..b38606a198d6b0f184f1f9a8d29331c8331982d3 100644 (file)
@@ -72,30 +72,28 @@ namespace internal
   class ActiveCellIterator
   {
   public:
+#ifndef _MSC_VER
     typedef typename MeshType::active_cell_iterator type;
+#else
+    typedef TriaActiveIterator<dealii::CellAccessor<dim, spacedim> > type;
+#endif
   };
 
+#ifdef _MSC_VER
   template <int dim, int spacedim>
   class ActiveCellIterator<dim, spacedim, dealii::DoFHandler<dim, spacedim> >
   {
   public:
-#ifndef _MSC_VER
-    typedef typename dealii::DoFHandler<dim, spacedim>::active_cell_iterator type;
-#else
-    typedef TriaActiveIterator < dealii::DoFCellAccessor < dealii::DoFHandler<dim, spacedim>, false > > type;
-#endif
+    typedef TriaActiveIterator < dealii::DoFCellAccessor < dealii::DoFHandler<dim, spacedim >, false> > type;
   };
 
   template <int dim, int spacedim>
   class ActiveCellIterator<dim, spacedim, dealii::hp::DoFHandler<dim, spacedim> >
   {
   public:
-#ifndef _MSC_VER
-    typedef typename dealii::hp::DoFHandler<dim, spacedim>::active_cell_iterator type;
-#else
-    typedef TriaActiveIterator < dealii::DoFCellAccessor < dealii::hp::DoFHandler<dim, spacedim>, false > > type;
-#endif
+    typedef TriaActiveIterator < dealii::DoFCellAccessor < dealii::hp::DoFHandler<dim, spacedim >, false> > type;
   };
+#endif
 }
 
 /**
@@ -2905,26 +2903,28 @@ namespace GridTools
             // cases.
             const double step_size = object->diameter()/64.0;
 
-            std::array<Point<spacedim>, GeometryInfo<structdim>::vertices_per_cell> vertices;
-            for (unsigned int vertex_n = 0; vertex_n < GeometryInfo<structdim>::vertices_per_cell;
+            constexpr unsigned int n_vertices_per_cell = GeometryInfo<structdim>::vertices_per_cell;
+
+            std::array<Point<spacedim>, n_vertices_per_cell> vertices;
+            for (unsigned int vertex_n = 0; vertex_n < n_vertices_per_cell;
                  ++vertex_n)
               vertices[vertex_n] = object->vertex(vertex_n);
 
             auto get_point_from_weights =
-              [&](const Tensor<1, GeometryInfo<structdim>::vertices_per_cell> &weights)
+              [&](const Tensor<1, n_vertices_per_cell> &weights)
               -> Point<spacedim>
             {
               return object->get_manifold().get_new_point
               (make_array_view(vertices.begin(), vertices.end()),
               make_array_view(&weights[0],
-              &weights[GeometryInfo<structdim>::vertices_per_cell - 1] + 1));
+              &weights[n_vertices_per_cell - 1] + 1));
             };
 
             // pick the initial weights as (normalized) inverse distances from
             // the trial point:
-            Tensor<1, GeometryInfo<structdim>::vertices_per_cell> guess_weights;
+            Tensor<1, n_vertices_per_cell> guess_weights;
             double guess_weights_sum = 0.0;
-            for (unsigned int vertex_n = 0; vertex_n < GeometryInfo<structdim>::vertices_per_cell;
+            for (unsigned int vertex_n = 0; vertex_n < n_vertices_per_cell;
                  ++vertex_n)
               {
                 const double distance = vertices[vertex_n].distance(trial_point);
@@ -2952,10 +2952,10 @@ namespace GridTools
             //
             for (unsigned int outer_n = 0; outer_n < 40; ++outer_n)
               {
-                const unsigned int dependent_direction = GeometryInfo<structdim>::vertices_per_cell - 1;
-                Tensor<1, GeometryInfo<structdim>::vertices_per_cell> current_gradient;
+                const unsigned int dependent_direction = n_vertices_per_cell - 1;
+                Tensor<1, n_vertices_per_cell> current_gradient;
                 for (unsigned int row_n = 0;
-                     row_n < GeometryInfo<structdim>::vertices_per_cell;
+                     row_n < n_vertices_per_cell;
                      ++row_n)
                   {
                     if (row_n != dependent_direction)
@@ -3021,7 +3021,7 @@ namespace GridTools
                 // between zero and one. If the update takes us outside of this
                 // region then rescale the update to stay within the region and
                 // try again
-                Tensor<1, GeometryInfo<structdim>::vertices_per_cell> tentative_weights =
+                Tensor<1, n_vertices_per_cell> tentative_weights =
                   guess_weights + gradient_weight*current_gradient;
 
                 double new_gradient_weight = gradient_weight;
@@ -3030,7 +3030,7 @@ namespace GridTools
                     if (internal::weights_are_ok<structdim>(tentative_weights))
                       break;
 
-                    for (unsigned int i = 0; i < GeometryInfo<structdim>::vertices_per_cell; ++i)
+                    for (unsigned int i = 0; i < n_vertices_per_cell; ++i)
                       {
                         if (tentative_weights[i] < 0.0)
                           {
index db3b1d7fede23a3f6cf44996e53bac0d258dfd38..58be672f13a4b02001ea92af0a99a69490601dd5 100644 (file)
@@ -93,7 +93,9 @@ public:
    * The DoFHandler is actually not needed.
    */
   template <int dim>
+#ifndef _MSC_VER
   DEAL_II_DEPRECATED
+#endif
   Multigrid(const DoFHandler<dim>              &mg_dof_handler,
             const MGMatrixBase<VectorType>     &matrix,
             const MGCoarseGridBase<VectorType> &coarse,
index 6ac4f7d380a3b42e2761b636047c6bfb23e79d74..6d38fa3dcbfbb0f0362f580f3a207307fb29976f 100644 (file)
@@ -1579,8 +1579,14 @@ namespace VectorTools
                 const Quadrature<dim-1>        &q_boundary,
                 const bool                      project_to_boundary_first)
   {
+#ifdef _MSC_VER
+    Assert(false,
+           ExcMessage("Please specify the mapping explicitly "
+                      "when building with MSVC!"));
+#else
     project(StaticMappingQ1<dim,spacedim>::mapping, dof, constraints, quadrature, function, vec,
             enforce_zero_boundary, q_boundary, project_to_boundary_first);
+#endif
   }
 
 
index c9e3d92011a37f97037a8e076ed37fdb13eecd3b..68e59a763db52e38cd4f01673aaf548247b1e20c 100644 (file)
@@ -297,6 +297,13 @@ namespace parallel
     Assert (false, ExcNotImplemented());
   }
 
+  template <int dim, int spacedim>
+  void
+  Triangulation<dim, spacedim>::fill_level_ghost_owners()
+  {
+    Assert(false, ExcNotImplemented());
+  }
+
 #endif
 
   template <int dim, int spacedim>
index 130916c3338c658147eb8c8bc716e60c76e9bcaa..84bba371ee2a7d19e8ba01250be1b8bebf3d3657 100644 (file)
@@ -119,7 +119,7 @@ namespace FEValuesViews
 // variables from FEValuesBase, but they aren't initialized yet
 // at the time we get here, so re-create it all
     const std::vector<unsigned int> shape_function_to_row_table
-      = internal::make_shape_function_to_row_table (fe);
+      = dealii::internal::make_shape_function_to_row_table (fe);
 
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
       {
@@ -180,7 +180,7 @@ namespace FEValuesViews
 // variables from FEValuesBase, but they aren't initialized yet
 // at the time we get here, so re-create it all
     const std::vector<unsigned int> shape_function_to_row_table
-      = internal::make_shape_function_to_row_table (fe);
+      = dealii::internal::make_shape_function_to_row_table (fe);
 
     for (unsigned int d=0; d<spacedim; ++d)
       {
@@ -278,7 +278,7 @@ namespace FEValuesViews
 // variables from FEValuesBase, but they aren't initialized yet
 // at the time we get here, so re-create it all
     const std::vector<unsigned int> shape_function_to_row_table
-      = internal::make_shape_function_to_row_table (fe);
+      = dealii::internal::make_shape_function_to_row_table (fe);
 
     for (unsigned int d = 0; d < dealii::SymmetricTensor<2,dim>::n_independent_components; ++d)
       {
@@ -377,7 +377,7 @@ namespace FEValuesViews
 // variables from FEValuesBase, but they aren't initialized yet
 // at the time we get here, so re-create it all
     const std::vector<unsigned int> shape_function_to_row_table
-      = internal::make_shape_function_to_row_table (fe);
+      = dealii::internal::make_shape_function_to_row_table (fe);
 
     for (unsigned int d = 0; d < dim*dim; ++d)
       {
@@ -2609,7 +2609,7 @@ namespace internal
       // the rows in the tables storing the data by shape function and
       // nonzero component
       this->shape_function_to_row_table
-        = internal::make_shape_function_to_row_table (fe);
+        = dealii::internal::make_shape_function_to_row_table (fe);
 
       // count the total number of non-zero components accumulated
       // over all shape functions
index c355dd79deab7860b2f345c71718afd53db6b53f..9a74d866a374c3e27f630ba60338daeae934ef31 100644 (file)
@@ -934,8 +934,8 @@ get_intermediate_point (const Point<spacedim> &p1,
                         const Point<spacedim> &p2,
                         const double w) const
 {
-  const std::array<Point<spacedim>, 2> points({{p1, p2}});
-  const std::array<double, 2> weights({{1.-w, w}});
+  const std::array<Point<spacedim>, 2> points {{p1, p2}};
+  const std::array<double, 2> weights {{1.-w, w}};
   return get_new_point(make_array_view(points.begin(), points.end()),
                        make_array_view(weights.begin(), weights.end()));
 }

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.