• Alexis SALZMAN's avatar
    [xFEM] change creator/updator argument type in xAlgo. declar/update · 0be44bc9
    Alexis SALZMAN authored
    Original DeclareInterpolation,UpdateInterpolation,DeclareState, ....
    were all using a std::function as argument type for creation/updating
    operation passed to those functions.
    
    G.L. discovers during xField templatization that old compiler where in
    default with the new signature of these arguments.
    In fact the problem comes from the fact that in general we provides a
    instance (xValueCreator, xStateDofCreator, ....) for these arguments.
    Says we rely on the compiler to do some binding of the instance to the
    std::function. With linked template instance things where to complex apparently
    for g++ 4.8.2.
    
    A more general approach is to consider a new template parameter for those
    arguments. This way either object function, std:function, lambdas, ...
    can be passed to these function. Now it's clear for the compiler and for
    the user: what is passed is something that correspond to a function
    with specific argument and returned value.
    For DeclareInterpolation, ....
    it's xValue<typename FIELD::value_t>* (const xValKey&) const
    
    Those argument are passed by reference to insure that "creator" are
    not copied. And to be able to call DeclareInterpolation,... with
    on the fly creation of "creator" those arguments are considered as
    const. This imply now that () operator of "creator" must be const.
    
    This is why in this commit many other files have been modified to
    respect this constness. Note that in most case "creator" () operator
    were intrinsically const. For some, mutable data member were needed.
    In all case considering that  DeclareInterpolation,... do not
    change the "creator" is rather logical.
    0be44bc9