From 4073ae090a7cabfe9ef99454b058821c654fdf0f Mon Sep 17 00:00:00 2001 From: janssen Date: Tue, 21 Sep 2010 11:19:41 +0000 Subject: [PATCH] added a function to set the precision of the output git-svn-id: https://svn.dealii.org/trunk@22102 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/numerics/mesh_worker_output.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/deal.II/deal.II/include/numerics/mesh_worker_output.h b/deal.II/deal.II/include/numerics/mesh_worker_output.h index 7141ac5853..46c3552fa8 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_output.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_output.h @@ -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() -- 2.39.5