]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Override the Q1 mapping in MappingQ.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 8 Sep 2015 15:24:17 +0000 (10:24 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 10 Sep 2015 19:36:45 +0000 (14:36 -0500)
source/fe/mapping_q_eulerian.cc
source/fe/mapping_q_eulerian.inst.in

index 67f069b640839bc20a32e1caf7fd66aee299fa0e..c7a91efb09562e9a11e0b05ce1a317f68eaaf187 100644 (file)
@@ -26,6 +26,7 @@
 #include <deal.II/fe/fe.h>
 #include <deal.II/fe/fe_tools.h>
 #include <deal.II/fe/mapping_q_eulerian.h>
+#include <deal.II/fe/mapping_q1_eulerian.h>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -46,7 +47,13 @@ MappingQEulerian (const unsigned int degree,
   fe_values(euler_dof_handler.get_fe(),
             support_quadrature,
             update_values | update_q_points)
-{ }
+{
+  // reset the q1 mapping we use for interior cells (and previously
+  // set by the MappingQ constructor) to a MappingQ1Eulerian with the
+  // current vector
+  this->q1_mapping.reset (new MappingQ1Eulerian<dim,EulerVectorType,spacedim>(euler_vector,
+                          euler_dof_handler));
+}
 
 
 
@@ -63,7 +70,13 @@ MappingQEulerian (const unsigned int degree,
   fe_values(euler_dof_handler.get_fe(),
             support_quadrature,
             update_values | update_q_points)
-{ }
+{
+  // reset the q1 mapping we use for interior cells (and previously
+  // set by the MappingQ constructor) to a MappingQ1Eulerian with the
+  // current vector
+  this->q1_mapping.reset (new MappingQ1Eulerian<dim,EulerVectorType,spacedim>(euler_vector,
+                          euler_dof_handler));
+}
 
 
 
@@ -101,8 +114,8 @@ SupportQuadrature (const unsigned int map_degree)
   for (unsigned int i=1; i<dpo.size(); ++i)
     dpo[i]=dpo[i-1]*(map_degree-1);
 
-  FETools::lexicographic_to_hierarchic_numbering (
-    FiniteElementData<dim> (dpo, 1, map_degree), renumber);
+  FETools::lexicographic_to_hierarchic_numbering (FiniteElementData<dim> (dpo, 1, map_degree),
+                                                  renumber);
 
   // finally we assign the quadrature points in the required order.
   for (unsigned int q=0; q<n_q_points; ++q)
@@ -116,9 +129,8 @@ SupportQuadrature (const unsigned int map_degree)
 template <int dim, class EulerVectorType, int spacedim>
 void
 MappingQEulerian<dim, EulerVectorType, spacedim>::
-compute_mapping_support_points
-(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- std::vector<Point<spacedim> > &a) const
+compute_mapping_support_points (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+                                std::vector<Point<spacedim> > &a) const
 {
 
   // first, basic assertion with respect to vector size,
@@ -153,7 +165,9 @@ compute_mapping_support_points
 
   Assert (n_components >= spacedim, ExcDimensionMismatch(n_components, spacedim) );
 
-  std::vector<Vector<double> > shift_vector(n_support_pts,Vector<double>(n_components));
+  std::vector<Vector<typename EulerVectorType::value_type> >
+  shift_vector(n_support_pts,
+               Vector<typename EulerVectorType::value_type>(n_components));
 
   // fill shift vector for each support point using an fe_values object. make
   // sure that the fe_values variable isn't used simultaneously from different
index caf91c5d5b066ecbe33c3daab08603b9934c8ff8..dd6397f73b0030532e1bc5d8d3d7374806f89d2b 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -18,6 +18,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
   {
 #if deal_II_dimension <= deal_II_space_dimension       
     template class MappingQEulerian<deal_II_dimension, Vector<double>, deal_II_space_dimension>;
+    template class MappingQEulerian<deal_II_dimension, Vector<float>,  deal_II_space_dimension>;
 #  ifdef DEAL_II_WITH_PETSC
     template class MappingQEulerian<deal_II_dimension,
                                    PETScWrappers::Vector, deal_II_space_dimension>;

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.