]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
added a function to set the precision of the output
authorjanssen <janssen@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 21 Sep 2010 11:19:41 +0000 (11:19 +0000)
committerjanssen <janssen@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 21 Sep 2010 11:19:41 +0000 (11:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@22102 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/mesh_worker_output.h

index 7141ac5853f2e70b89567901415dba5e39b954ea..46c3552fa8629c2bd4702819e826ea8797ab44eb 100644 (file)
@@ -63,6 +63,16 @@ namespace MeshWorker
                                          */
        void initialize_stream(std::ostream& stream);
 
+                                        /**
+                                         * Set the precision
+                                          * of the stream to
+                                         * which data is written. If
+                                         * no stream was selected with
+                                         * initialize_stream(), this 
+                                          * effects #deallog.
+                                         */
+        void set_precision (const unsigned int n);
+
                                         /**
                                          * Initialize the local data
                                          * in the
@@ -140,6 +150,14 @@ namespace MeshWorker
        (*os) << std::endl;
     }
 
+    inline void
+    GnuplotPatch::set_precision(const unsigned int n)
+    {
+      if (os == 0)
+        deallog << std::setprecision(n);
+      else
+        (*os) << std::setprecision(n);
+    }
 
     inline
     GnuplotPatch::GnuplotPatch()

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.