Hi Daniel,
> I do not really understand why you pass b[] as third argument
Because it is the right-hand-side.
> it is not a double as expected from the definition of solve.
No, b[] is a double (so is b[0], so is b[1,-1] etc.).
b is a scalar.
> On the other hand it does not make sense to pass a double but rather a scalar,
> so I guess that b[] is the way you have to pass a scalar
No, it does not make sense to pass a scalar i.e. b
It makes sense to pass a double i.e. b[]
or 0.
or b[] + 1.
or 2.*b[] + (c[1] - c[-1])/Delta
etc.
> Can you confirm that this is the correct syntax?
yes, b[] is the correct syntax.
> why you changed with respect to the previous one which was more intuitive? (at least for me..)
because it does not make sense to restrict the right-hand-side to the
central value of a single scalar field. For example, with the old syntax
if you wanted to use a right-hand-side which was e.g. c[] + 1. you would
have had to write something like:
scalar b[];
foreach()
b[] = c[] + 1.;
solve (..., b);
with the new syntax you can just write:
solve (..., c[] + 1.);
cheers,
Stephane
PS: you may also want to (re)read
http://basilisk.fr/src/ast/macro.h#macro-expansion