Compiler warning in using mesh refinement with bool redistribute = true

Issue #601 new
Haibo Ni created an issue

in Compiling cpp code with mesh refinement came up with the following warning:

/home/haibo/MPI_Test/Mech/Mech.cpp:77:45: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
  mesh_elec = refine( refine(mesh_mech, false), false);
                                             ^
In file included from /home/haibo/.hashdist/bld/dolfin/jskyvwal4lkq/include/dolfin/refinement/dolfin_refinement.h:6:0,
                 from /home/haibo/.hashdist/bld/dolfin/jskyvwal4lkq/include/dolfin.h:18,
                 from /home/haibo/MPI_Test/Mech/Mech.cpp:8:
/home/haibo/.hashdist/bld/dolfin/jskyvwal4lkq/include/dolfin/refinement/refine.h:55:8: note: candidate 1: dolfin::Mesh dolfin::refine(const dolfin::Mesh&, bool)
   Mesh refine(const Mesh& mesh, bool redistribute = true);
        ^
/home/haibo/.hashdist/bld/dolfin/jskyvwal4lkq/include/dolfin/refinement/refine.h:72:8: note: candidate 2: void dolfin::refine(dolfin::Mesh&, const dolfin::Mesh&, bool)
   void refine(Mesh& refined_mesh, const Mesh& mesh,
        ^

Guess needed to be improved?

Comments (7)

  1. Jan Blechta

    Using C++11 enums did not went so smoothly as expected. TimingType C++ doc was not generated so it needed to be documented manually in every function using it (for instance). SWIG generated variable dolfin.TimingType_wall == 0 and so on and docstrings needed to be fixed manually :(

  2. Chris Richardson

    I'm less keen on enums. I think refine should be called with some kind of struct containing parameters, which can include asking for parent facets/cells, whether or not to redistribute the mesh, and the agressiveness of refinement required (e.g. whether marking a Cell requires all edges to be bisected, or just the longest edge). I don't want a long string of bool or enum for this.

  3. Chris Richardson

    Well, I guess the number of options is exactly the kind of thing that is likely to change over time, as we add new features.

  4. Log in to comment