From 96ce85a9b6e93f71b0ee6db3b27f064d6bf77acb Mon Sep 17 00:00:00 2001 From: janssen Date: Tue, 16 Mar 2010 21:03:50 +0000 Subject: [PATCH] Assembler::GnuplotPatch implemented git-svn-id: https://svn.dealii.org/trunk@20836 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/numerics/mesh_worker_output.h | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) 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 68bfcd2fec..0e557c67af 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_output.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_output.h @@ -37,6 +37,7 @@ namespace MeshWorker */ class GnuplotPatch { + public: /** * Constructor. */ @@ -98,11 +99,6 @@ namespace MeshWorker void assemble(const DoFInfo& info1, const DoFInfo& info2); - /** - * The value of the ith entry - * in #results. - */ - number operator() (unsigned int i) const; private: /** * Write the object T either @@ -113,6 +109,8 @@ namespace MeshWorker */ template void write(const T& t) const; + + void write_endl () const; unsigned int patch_dimension; unsigned int n_vectors; @@ -123,7 +121,7 @@ namespace MeshWorker //----------------------------------------------------------------------// - template + template inline void GnuplotPatch::write(const T& d) const { @@ -132,9 +130,18 @@ namespace MeshWorker else (*os) << d; } + + inline void + GnuplotPatch::write_endl() const + { + if (os == 0) + deallog << std::endl; + else + (*os) << std::endl; + } - inline void + inline GnuplotPatch::GnuplotPatch() : os(0) @@ -142,10 +149,10 @@ namespace MeshWorker inline void - GnuplotPatch::initialize(unsigned int dim, unsigned int nv, unsigned int np) + GnuplotPatch::initialize(unsigned int dim, unsigned int np, unsigned int nv) { patch_dimension = dim; - n_vectors = n; + n_vectors = nv; n_points = np; } @@ -159,8 +166,7 @@ namespace MeshWorker template inline void - GnuplotPatch::initialize_info(DoFInfo& info, - bool interior_face) + GnuplotPatch::initialize_info(DoFInfo& info, bool) { AssertDimension(patch_dimension,dim); info.initialize_quadrature(n_points, n_vectors); @@ -171,17 +177,35 @@ namespace MeshWorker inline void GnuplotPatch::assemble(const DoFInfo& info) { - + const unsigned int n_q_points = info.n_quadrature_points(); + const unsigned int nv = info.n_quadrature_values(); + const unsigned int square_root = std::pow(n_q_points, 1./dim)+.5; + for (unsigned int k1=0; k1 inline void - GnuplotPatch::assemble(const DoFInfo& info1, const DoFInfo& info2) + GnuplotPatch::assemble(const DoFInfo& /*info1*/, const DoFInfo& /*info2*/) { - + Assert(false, ExcNotImplemented()); } } } +DEAL_II_NAMESPACE_CLOSE + #endif -- 2.39.5