no output despite set_log_level(PROGRESS)

Issue #58 new
Nico Schlömer created an issue

Since https://bitbucket.org/fenics-project/mshr/issues/52, mshr doesn't seem to produce any output anymore, even when setting dolfin.set_log_level(dolfin.PROGRESS).

MWE:

#! /usr/bin/env python
# -*- coding: utf-8 -*-
import dolfin
import mshr
import numpy as np

dolfin.set_log_active(True)
dolfin.set_log_level(dolfin.PROGRESS)


def create_circle_mesh():
    circle = mshr.Circle(dolfin.Point(0.0, 0.0), 1.0)
    m = mshr.generate_mesh(circle, 50, 'cgal')
    coords = m.coordinates()
    return np.hstack((coords, np.zeros((coords.shape[0], 1)))), m.cells()

if __name__ == '__main__':
    import meshio
    points, cells = create_circle_mesh()
    meshio.write('circle.vtu', points, {'triangle': cells})

Comments (4)

  1. Benjamin Dam Kehlet

    The 2D mesh generator has never output during generation (issue #52 modified only the 3D code). It is not too hard to add if there is a need (but generating the mesh in your example takes only 0.08 seconds on my computer)

  2. Nico Schlömer reporter

    Depends on the mesh size, I guess. :) This came up with Lloyd smoothing which can take a significant amount of time.

  3. Stefano Ottolenghi

    This works for me (with a 2D geometry) providing a numerical value, like

    dolfin.set_log_level(1)

    I am not sure what is the exact mapping between string and int error levels, but low integers correspond to low importance ones (extrapolated from line 444 of log/Logger.ccp, function Logger::write: if (!_active || log_level < _log_level)).

  4. Log in to comment