On 27 February 2014 11:39, Martin Sandve Alnæs <[email protected]> wrote:
> The core lines of the issue being fixed are these: > > u0 = project( u0, V ) > #missing u0.update() > bc = DirichletBC(V, u0, u0_boundary) > > In my opinion, _project_ seems to be the one that's missing the update, > not DBC which the pull request tries to add it to. > > This seems to be to be a rather fundamental issue cross cutting all of > dolfin which needs to be done consistently. Should the operation that > modifies u0 or the operation that inspects u0 call u0.update()? > > In my opinion, as a rule of thumb it has to be the operation that > modifies that should call update. > > I.e. in this code only a single update after project is needed, not one > for bc1 and one for bc2: > u0 = project( u0, V ) > #missing u0.update() > bc1 = DirichletBC(V, u0, u0_boundary1) > bc2 = DirichletBC(V, u0, u0_boundary2) > > And if vectors are modified directly, the user is responsible for > calling update when finished. > The Firedrake solution to this last one is that any user access to the vector data (you can trap this case because it happens in the python layer) dirties the halos. This isolates users from subtle bugs. For clued up users who need to access the vector data to read it, and who therefore promise to us that they are not dirtying the halos, we provide a separate property for read only access to the vector (of course nothing actually stops the user writing to it, but it makes it much more obvious that they are doing something naughty). > > Martin > > > On 27 February 2014 11:29, Martin Sandve Alnæs <[email protected]> wrote: > >> Hidden behind a pull request there was a discussion now about the right >> place to insert function.update() calls. >> >> >> https://bitbucket.org/fenics-project/dolfin/pull-request/117/fix-issue-263/diff#comment-1317810 >> >> I found the discussion to be important so instead of continuing there I >> add my 2 cents here: >> >> Requiring the user to call update at the correct places according to >> what the dolfin implementation under the hood requires at any particular >> time would be a massive blow to usability. How can anyone be expected to do >> that correctly without knowing in detail how dolfin components are >> implemented? >> >> Martin >> > > -- Dr David Ham Departments of Mathematics and Computing Imperial College London http://www.imperial.ac.uk/people/david.ham
_______________________________________________ fenics mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics
