]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
optionally plot all faces\
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 5 Aug 2011 16:17:07 +0000 (16:17 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 5 Aug 2011 16:17:07 +0000 (16:17 +0000)
but for unexplicable reasons, this does not use FEFaceValues

git-svn-id: https://svn.dealii.org/trunk@24020 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/numerics/data_out_faces.h
deal.II/source/numerics/data_out_faces.cc

index 3d54658572bb935ad95d6e51d4072c3849bf2444..1e9439706c1f7033c5e9b6dfacffbb0c0ee8e142 100644 (file)
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -60,15 +60,15 @@ namespace internal
 
 
 /**
- * This class generates output from faces of a triangulation rather
- * than from cells, as do for example the DataOut and
- * DataOut_Rotation() classes. It might be used to generate output
- * only for the surface of the triangulation (this is the default of
- * this class), or for another arbitrary set of faces. The output of
- * this class is a set of patches (as defined by the class
- * DataOutBase::Patch()), one for each face for which output is to
- * be generated. These patches can then be written in several
- * graphical data formats by the functions of the underlying classes.
+ * This class generates output from faces of a triangulation. It might
+ * be used to generate output only for the surface of the
+ * triangulation (this is the default of this class), or for all faces
+ * of active cells, as specified in the constructor.
+ * The output of this class is a set of
+ * patches (as defined by the class DataOutBase::Patch()), one for
+ * each face for which output is to be generated. These patches can
+ * then be written in several graphical data formats by the functions
+ * of the underlying classes.
  *
  * <h3>Interface</h3>
  *
@@ -81,11 +81,10 @@ namespace internal
  * <h3>Extending this class</h3>
  *
  * The sequence of faces to generate patches from is generated in the
- * same way as in the DataOut class, see there for a description
- * of the respective interface. For obvious reasons, the functions
- * generating the sequence of faces which shall be used to generate
- * output, are called @p first_face and @p next_face in this class,
- * rather than @p first_cell and @p next_cell.
+ * same way as in the DataOut class; see there for a description of
+ * the respective interface. The functions generating the sequence of
+ * faces which shall be used to generate output, are called
+ * first_face() and next_face().
  *
  * Since we need to initialize objects of type FEValues with the
  * faces generated from these functions, it is not sufficient that
@@ -111,8 +110,10 @@ namespace internal
  * applications certainly exist, for which the author is not
  * imaginative enough.
  *
+ * @todo Reimplement this whole class using actual FEFaceValues and MeshWorker.
+ *
  * @ingroup output
- * @author Wolfgang Bangerth, 2000
+ * @author Wolfgang Bangerth, Guido Kanschat, 2000, 2011
  */
 template <int dim, class DH=DoFHandler<dim> >
 class DataOutFaces : public DataOut_DoFData<DH,DH::dimension-1,
@@ -127,6 +128,14 @@ class DataOutFaces : public DataOut_DoFData<DH,DH::dimension-1,
     typedef typename DataOut_DoFData<DH,DH::dimension-1,
                                     DH::dimension>::cell_iterator cell_iterator;
 
+                                    /**
+                                     * Constructor determining
+                                     * whether a surface mesh
+                                     * (default) or the whole wire
+                                     * basket is written.
+                                     */
+    DataOutFaces (const bool surface_only = true);
+    
                                      /**
                                      * This is the central function
                                      * of this class since it builds
@@ -215,34 +224,48 @@ class DataOutFaces : public DataOut_DoFData<DH,DH::dimension-1,
                                      * Return the first face which we
                                      * want output for. The default
                                      * implementation returns the
-                                     * first active face on the
-                                     * boundary, but you might want
-                                     * to return another face in a
+                                     * first face of an active cell
+                                     * or the first such on the
+                                     * boundary.
+                                     *
+                                     * For more general sets,
+                                     * overload this function in a
                                      * derived class.
                                      */
     virtual FaceDescriptor first_face ();
     
                                     /**
                                      * Return the next face after
-                                     * @p face which we want output
-                                     * for.  If there are no more
-                                     * face, <tt>dofs->end()</tt> shall be
+                                     * which we want output
+                                     * for. If there are no more
+                                     * faces, <tt>dofs->end()</tt> is
                                      * returned as the first
                                      * component of the return value.
                                      *
                                      * The default implementation
-                                     * returns the next active face
-                                     * on the boundary, but you might
-                                     * want to return other faces in
-                                     * a derived class. Note that the
+                                     * returns the next face of an
+                                     * active cell, or the next such
+                                     * on the boundary.
+                                     *
+                                     * This function traverses the
+                                     * mesh cell by cell (active
+                                     * only), and then through all
+                                     * faces of the cell. As a
+                                     * result, interior faces are
+                                     * output twice.
+
+                                     * This function can be
+                                     * overloaded in a derived
+                                     * class to select a different
+                                     * set of faces. Note that the
                                      * default implementation assumes
                                      * that the given @p face is
                                      * active, which is guaranteed as
-                                     * long as @p first_face is also
+                                     * long as first_face() is also
                                      * used from the default
                                      * implementation. Overloading
                                      * only one of the two functions
-                                     * might not be a good idea.
+                                     * should be done with care.
                                      */
     virtual FaceDescriptor next_face (const FaceDescriptor &face);
 
@@ -260,6 +283,13 @@ class DataOutFaces : public DataOut_DoFData<DH,DH::dimension-1,
     DeclException0 (ExcCellNotActiveForCellData);
     
   private:
+                                    /**
+                                     * Parameter deciding between
+                                     * surface meshes and full wire
+                                     * basket.
+                                     */
+    const bool surface_only;
+    
                                     /**
                                      * Build one patch. This function
                                      * is called in a WorkStream
index 56e49aeafdfd08e1c13b0597c3794c4e902eead9..f051172aff44a9c0018e5a91fa63915842aa4c7a 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -79,6 +79,12 @@ namespace internal
 }
 
 
+template <int dim, class DH>
+DataOutFaces<dim,DH>::DataOutFaces(const bool so)
+               :
+               surface_only(so)
+{}
+
 
 template <int dim, class DH>
 void
@@ -382,7 +388,7 @@ DataOutFaces<dim,DH>::first_face ()
   typename DH::active_cell_iterator cell = this->dofs->begin_active();
   for (; cell != this->dofs->end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
-      if (cell->face(f)->at_boundary())
+      if (!surface_only || cell->face(f)->at_boundary())
        return FaceDescriptor(cell, f);
 
                                   // ups, triangulation has no
@@ -404,7 +410,7 @@ DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
                                   // cell has more faces on the
                                   // boundary
   for (unsigned int f=face.second+1; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
-    if (face.first->face(f)->at_boundary())
+    if (!surface_only || face.first->face(f)->at_boundary())
                                       // yup, that is so, so return it
       {
        face.second = f;
@@ -429,7 +435,7 @@ DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
                                       // check all the faces of this
                                       // active cell
       for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
-       if (active_cell->face(f)->at_boundary())
+       if (!surface_only || active_cell->face(f)->at_boundary())
          {
            face.first  = active_cell;
            face.second = f;

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.