]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
change point coordinates to int
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 15 Oct 2003 21:27:58 +0000 (21:27 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 15 Oct 2003 21:27:58 +0000 (21:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@8091 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_out.cc

index 0c86df7485d5419f1f9cb76daf195a0cd4e8d763..44b7eb86fc13b75cc0543e6b3f927f50cc731926 100644 (file)
@@ -379,11 +379,16 @@ void GridOut::write_xfig (const Triangulation<dim>&,
 
 #else
 
+//TODO:[GK] Write boundary faces
+//TODO:[GK] Obey parameters
+//TODO:[GK] Flip y-axis?
 template <int dim>
 void GridOut::write_xfig (const Triangulation<dim>& tria,
                          std::ostream&             out,
                          const Mapping<dim>*       mapping)
 {
+  const unsigned int nv = GeometryInfo<dim>::vertices_per_cell;
+  const unsigned int nf = GeometryInfo<dim>::faces_per_cell;
                                   // The following text was copied
                                   // from an existing XFig file.
   out << "#FIG 3.2\nLandscape\nCenter\nInches" << std::endl
@@ -413,23 +418,24 @@ void GridOut::write_xfig (const Triangulation<dim>& tria,
                                         // some style parameters
          << " 0 0 -1 0 0 "
                                         // number of points
-         << '5' << std::endl;
+         << nv+1 << std::endl;
 
                                       // For each point, write scaled
                                       // and shifted coordinates
                                       // multiplied by 1200
                                       // (dots/inch)
-      const unsigned int nv = GeometryInfo<dim>::vertices_per_cell;
       for (unsigned int k=0;k<=nv;++k)
        {
          const Point<dim>& p = cell->vertex(k % nv);
          for (unsigned int d=0;d<dim;++d)
            {
-             out << '\t'
-                 << 1200 * (p(d)-xfig_flags.offset(d)) * xfig_flags.scaling(d);
+             int val = (int)(1200 * xfig_flags.scaling(d) *
+                             (p(d)-xfig_flags.offset(d)));
+             out << '\t' << val;
            }
          out << std::endl;
        }
+                                      // Now write boundary edges
     }
 }
 #endif

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.