Unwanted output while meshing a Sphere with mshr

Issue #52 resolved
Prof Garth Wells created an issue

Comments (10)

  1. Nico Schlömer

    I've filed a CGAL bug here.

    As a workaround, since all the output from CGAL goes to std::cerr, one could just pipe that somewhere else, e.g.,

    python create_mesh.py 2> /dev/null
    
  2. Benjamin Dam Kehlet

    Not sure if the CGAL guys consider this a bug. The problem with turning off the output is that it since the meshing often takes time, the program appears to hang. For a fix in CGAL to be usefull, we need to be able set the stream (not only control the verbosity), so we can send it through the dolfin streams. It should, however, be possible to fix this in mshr, by turning of the output from CGAL and, while the mesh is being genereted, output from a separate thread through the dolfin streams. The "outputting thread" could query the triangulation object where the mesh is being generated for eg. the number of cells, so the user can see that the mesh generation is progressing. (This would also avoid the performance penalty that the outputting from the same thread represents)

  3. Nico Schlömer

    They do have set_verbosity(...) in other places, so I thought they might add it there. If you have anything to say (-> output streams), it's probably best done over there.

  4. Benjamin Dam Kehlet

    I have pushed a fix for this now. In order to be responsive during the (possibly) time consuming mesh generation a separate thread queries the triangulation and outputs the current number of cells and vertices. I have looked into the CGAL code and believe this is thread safe. Please reopen or register a new issue if you experience any problems with this.

    The progress during mesh generation is reported with log level PROGRESS which means it is turned off by default.

    (As a nice side effect, I have experienced ~10% speed up since the debug output from CGAL that used to be enabled is pretty expensive to compute)

  5. Log in to comment