← Back to team overview

dolfin team mailing list archive

Removal of disp() function

 

The way DOLFIN handles printing information about objects has
undergone some major surgery.

The disp() function has been removed from all classes.

Instead, one should use the info() function, which can now print
objects as well as strings:

  info(mesh);
  info(x);
  info(u.vector());
  info(dof_map);
  etc.

or alternatively

  dolfin::cout << mesh << dolfin::endl;
  etc

The above examples print one-line summaries such as

  <Mesh of topological dimension 2 (triangles) with 16 vertices and 18 cells, ordered>

To print detailed information (for objects that support it), add an
extra argument to set the verbosity flag to true:

  info(mesh, true);

Both info() and cout rely on the str() method which is defined by the
base class Variable and then overloaded in subclasses.

I had to edit quite a number of classes to make this work so there's a
great chance improvements are needed regarding spelling, formatting
etc. Just send a patch if something looks ugly.

--
Anders

Attachment: signature.asc
Description: Digital signature