I don't mind if you change get_scalar_value into operator double. But keep in mind that if apply is not called after the last add, the value will be incorrect. Maybe a dirty flag can be set to make that safe.
Martin On 20 November 2014 14:27, Martin Sandve Alnæs <[email protected]> wrote: > How do you use it from user code? It's important now to call apply before > extracting the value. Some times breaking code is better than a > silent behaviour change... > > Martin > > On 20 November 2014 14:23, Martin Sandve Alnæs <[email protected]> wrote: > >> I thought Scalar was only used internally by the assembler? That's why I >> didn't consider this an interface change. >> >> Martin >> >> On 20 November 2014 14:22, Martin Sandve Alnæs <[email protected]> >> wrote: >> >>> That's correct, I extended Scalar to work properly in parallel to fix >>> that bug. >>> >>> I think I found the idea of "operator double" dubious because it will >>> now involve MPI communication. It's only used from inside the assembler. >>> >>> The function get_scalar_value is public mainly to keep the tests >>> working, as I discovered unit tests that didn't work before. >>> >>> Martin >>> >>> On 20 November 2014 14:18, Jan Blechta <[email protected]> >>> wrote: >>> >>>> Maybe because of this >>>> >>>> https://bitbucket.org/fenics-project/dolfin/issue/388/scalar-apply-is-wrong >>>> >>>> Jan >>>> >>>> >>>> On Thu, 20 Nov 2014 14:12:36 +0100 >>>> Anders Logg <[email protected]> wrote: >>>> >>>> > When was this added to Scalar and when/why was conversion to double >>>> > removed? >>>> > >>>> >>>> _______________________________________________ >>>> fenics mailing list >>>> [email protected] >>>> http://fenicsproject.org/mailman/listinfo/fenics >>>> >>> >>> >> >
_______________________________________________ fenics mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics
