From b6e9003c0bc7d2a5124ffb45d70d8311fff440eb Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 8 Mar 2007 21:59:36 +0000 Subject: [PATCH] Generate output in dot format. git-svn-id: https://svn.dealii.org/trunk@14558 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/dofs/dof_constraints.h | 24 +++++++++++++++++++ .../deal.II/source/dofs/dof_constraints.cc | 20 +++++++++++++++- deal.II/doc/news/changes.html | 10 ++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/include/dofs/dof_constraints.h b/deal.II/deal.II/include/dofs/dof_constraints.h index 18b410c3a3..cdcfe0c01c 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.h @@ -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) diff --git a/deal.II/deal.II/source/dofs/dof_constraints.cc b/deal.II/deal.II/source/dofs/dof_constraints.cc index 5fb4f60407..50d6998f6b 100644 --- a/deal.II/deal.II/source/dofs/dof_constraints.cc +++ b/deal.II/deal.II/source/dofs/dof_constraints.cc @@ -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 { diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 27662bfb78..d149b5503f 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -1023,6 +1023,16 @@ inconvenience this causes.

deal.II

    +
  1. New: The + ConstraintMatrix::write_dot 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. +
    + (WB 2007/03/08) +

    +
  2. Fixed: The GridGenerator::cylinder function in 3d properly set the boundary indicators of the end faces of the generated -- 2.39.5