Compiler warning in using mesh refinement with bool redistribute = true
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)
-
-
- edited description
-
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 variabledolfin.TimingType_wall == 0
and so on and docstrings needed to be fixed manually :( -
I'm less keen on enums. I think
refine
should be called with some kind ofstruct
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 aCell
requires all edges to be bisected, or just the longest edge). I don't want a long string ofbool
orenum
for this. -
Let's exclude
bool
. Can we anticipate how many options we might want to pass torefine
? -
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.
-
- removed milestone
Removing milestone: 1.7 (automated comment)
- Log in to comment
We should change the
bool
to anenum
.