]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Generate output in dot format.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 8 Mar 2007 21:59:36 +0000 (21:59 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 8 Mar 2007 21:59:36 +0000 (21:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@14558 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_constraints.h
deal.II/deal.II/source/dofs/dof_constraints.cc
deal.II/doc/news/changes.html

index 18b410c3a3ec315ac79385a766fcc454b594d51e..cdcfe0c01ceb94fff0be0359d18394b4a5e8aef0 100644 (file)
@@ -806,6 +806,30 @@ class ConstraintMatrix : public Subscriptor
                                      */
     void print (std::ostream &) const;
 
+                                    /**
+                                     * Write the graph of constraints
+                                     * in 'dot' format. 'dot' is a
+                                     * program that can take a list
+                                     * of nodes and produce a
+                                     * graphical representation of
+                                     * the graph of constrained
+                                     * degrees of freedom and the
+                                     * degrees of freedom they are
+                                     * constrained to.
+                                     *
+                                     * The output of this function
+                                     * can be used as input to the
+                                     * 'dot' program that can convert
+                                     * the graph into a graphical
+                                     * representation in postscript,
+                                     * png, xfig, and a number of
+                                     * other formats.
+                                     *
+                                     * This function exists mostly
+                                     * for debugging purposes.
+                                     */
+    void write_dot (std::ostream &) const;
+
                                     /**
                                      * Determine an estimate for the
                                      * memory consumption (in bytes)
index 5fb4f604079ccc60e4123b929869afef1a8bc2a6..50d6998f6b1058ded6682583f67119cb7d83092b 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -1383,6 +1383,24 @@ void ConstraintMatrix::print (std::ostream &out) const
 
 
 
+void
+ConstraintMatrix::write_dot (std::ostream &out) const
+{
+  out << "digraph constraints {"
+      << std::endl;
+  for (unsigned int i=0; i!=lines.size(); ++i)
+    {
+      out << "  n" << i << " label=\"" << i << "\";"
+         << std::endl;
+      for (unsigned int j=0; j!=lines[i].entries.size(); ++j)
+       out << "  n" << i << "->n" << lines[i].entries[j].first << ";"
+           << std::endl;
+    }
+  out << "}" << std::endl;
+}
+
+
+
 unsigned int
 ConstraintMatrix::memory_consumption () const
 {
index 27662bfb7828a4889849b01e13d8dabb6771f26a..d149b5503fc5bb721885de4cf530ec256c7490f4 100644 (file)
@@ -1023,6 +1023,16 @@ inconvenience this causes.
 <h3>deal.II</h3>
 
 <ol>
+   <li> <p>New: The
+       <code>ConstraintMatrix::write_dot</code> function can be used
+       to produce a graphical representation of the graph of
+       constraints stored in the constraint matrix. The output can be
+       sent through the "dot" program to produce a number of graphical
+       formats, such as postscript, png, or xfig.
+       <br>
+       (WB 2007/03/08)
+       </p>
+
    <li> <p>Fixed: The
        <code>GridGenerator::cylinder</code> function in 3d properly
        set the boundary indicators of the end faces of the generated

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.