]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fixed mappingq1eulerian to work with codim one meshes
authorLuca Heltai <luca.heltai@sissa.it>
Mon, 27 Apr 2009 17:33:40 +0000 (17:33 +0000)
committerLuca Heltai <luca.heltai@sissa.it>
Mon, 27 Apr 2009 17:33:40 +0000 (17:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@18757 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/mapping_q1_eulerian.h
deal.II/deal.II/source/fe/mapping_q1_eulerian.cc

index 4fb9edd62711ccb94ad574af516b9b175e7b7d0e..6ac156bb147b65647a066a7b481304ce4e5734c5 100644 (file)
@@ -111,7 +111,7 @@ class MappingQ1Eulerian : public MappingQ1<dim,spacedim>
                                      * <tt>DoFAccessor::set_dof_values()</tt>.
                                      */
     MappingQ1Eulerian (const EulerVectorType  &euler_transform_vectors,
-                       const DoFHandler<dim> &shiftmap_dof_handler);
+                       const DoFHandler<dim,spacedim> &shiftmap_dof_handler);
     
                                      /**
                                       * Return a pointer to a copy of the
@@ -172,7 +172,7 @@ class MappingQ1Eulerian : public MappingQ1<dim,spacedim>
                                      * which the mapping vector is
                                      * associated.
                                      */
-    const SmartPointer<const DoFHandler<dim> > shiftmap_dof_handler;
+    const SmartPointer<const DoFHandler<dim,spacedim> > shiftmap_dof_handler;
     
 
   private:    
@@ -183,8 +183,8 @@ class MappingQ1Eulerian : public MappingQ1<dim,spacedim>
                                      * are the vertices.
                                      */
     virtual void compute_mapping_support_points(
-      const typename Triangulation<dim>::cell_iterator &cell,
-      std::vector<Point<dim> > &a) const;
+       const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+      std::vector<Point<spacedim> > &a) const;
     
 };
 
index 15cb638043dc6d58f574ed5996cfcbfa60e9940a..4444b1bab89fd12cc0632a8cc7fe0623c038d6a2 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -26,7 +26,7 @@ DEAL_II_NAMESPACE_OPEN
 template <int dim, class EulerVectorType, int spacedim>
 MappingQ1Eulerian<dim, EulerVectorType, spacedim>::
 MappingQ1Eulerian (const EulerVectorType  &euler_transform_vectors,
-                  const DoFHandler<dim> &shiftmap_dof_handler)
+                  const DoFHandler<dim,spacedim> &shiftmap_dof_handler)
                    :
                   euler_transform_vectors(euler_transform_vectors),
                   shiftmap_dof_handler(&shiftmap_dof_handler)
@@ -37,8 +37,8 @@ MappingQ1Eulerian (const EulerVectorType  &euler_transform_vectors,
 template <int dim, class EulerVectorType, int spacedim>
 void
 MappingQ1Eulerian<dim, EulerVectorType, spacedim>::
-compute_mapping_support_points(const typename Triangulation<dim>::cell_iterator &cell,
-                              std::vector<Point<dim> > &a) const
+compute_mapping_support_points(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+                              std::vector<Point<spacedim> > &a) const
 {
 
                                   // The assertions can not be in the
@@ -48,9 +48,9 @@ compute_mapping_support_points(const typename Triangulation<dim>::cell_iterator
                                   // *before* the mapping object is
                                   // constructed, which is not
                                   // necessarily what we want.
-  Assert (dim == shiftmap_dof_handler->get_fe().n_dofs_per_vertex(),
+  Assert (spacedim == shiftmap_dof_handler->get_fe().n_dofs_per_vertex(),
           ExcWrongNoOfComponents());
-  Assert (shiftmap_dof_handler->get_fe().n_components() == dim,
+  Assert (shiftmap_dof_handler->get_fe().n_components() == spacedim,
          ExcWrongNoOfComponents());
 
   Assert (shiftmap_dof_handler->n_dofs() == euler_transform_vectors.size(),
@@ -63,8 +63,8 @@ compute_mapping_support_points(const typename Triangulation<dim>::cell_iterator
                                   // DoFHandler<dim>::cell_iterator
                                   // which is necessary for access to
                                   // DoFCellAccessor::get_dof_values()
-  typename DoFHandler<dim>::cell_iterator
-    dof_cell (const_cast<Triangulation<dim> *> (&(cell->get_triangulation())),
+  typename DoFHandler<dim,spacedim>::cell_iterator
+    dof_cell (const_cast<Triangulation<dim,spacedim> *> (&(cell->get_triangulation())),
              cell->level(),
              cell->index(),
              shiftmap_dof_handler);
@@ -87,15 +87,15 @@ compute_mapping_support_points(const typename Triangulation<dim>::cell_iterator
 
   for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
     {
-      Point<dim> shift_vector;
+      Point<spacedim> shift_vector;
 
                                       // pick out the value of the
                                       // shift vector at the present
                                       // vertex. since vertex dofs
                                       // are always numbered first,
                                       // we can access them easily
-      for (unsigned int j=0; j<dim; ++j)
-       shift_vector[j] = mapping_values(i*dim+j);
+      for (unsigned int j=0; j<spacedim; ++j)
+       shift_vector[j] = mapping_values(i*spacedim+j);
 
                                       // compute new support point by
                                       // old (reference) value and
@@ -147,4 +147,12 @@ template class MappingQ1Eulerian<deal_II_dimension, Vector<double> >;
 template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector>;
 #endif
 
+// Explicit instantiation for codimension one problems.
+#if deal_II_dimension != 3
+template class MappingQ1Eulerian<deal_II_dimension, Vector<double>, deal_II_dimension+1 >;
+#      ifdef DEAL_II_USE_PETSC
+template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector, deal_II_dimension+1>;
+#      endif
+#endif
+
 DEAL_II_NAMESPACE_CLOSE

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.