Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2008-03-20 08:44:50


On 03/18/08 17:23, Markus Werle wrote:
[snip]
>
> I am dreaming of:
>
> scalar_field<0> rho;
> scalar_field<1> u;
> scalar_field<2> v;
> ....
>
> Solver.AddPDESystem()
> [ddt(rho) + ddx(rho * u) + ddy(rho * v) + sourceterm == 0],
> [ddt(rho * u) + ddx(rho * pow<2, 1>(u)) + ddy(rho * u * v) == 0],
> [.. some other 10-20 partial differential eqns. omitted ];
>
[snip]
> In chemistry there are systems with more than 100 equations of this form.
> One day proto will bend before such usecases. You've been warned ;-)

Spirit has something similar except it's equations always have a
single variable (a.k.a. nonterminal in grammar parlance) on one
side of the equation. For example, the calculator::definition
CTOR here:

http://www.boost.org/libs/spirit/example/fundamental/full_calc.cpp

Spirit uses pointer's to the rhs stored in spirit::rule's which
avoids, somewhat, the compiler limitations. Maybe you could
do something similar.

This sequence of grammar equations (a.k.a. productions)
and a solution to these equations for non-terminal
lookaheads is prototyped using proto in cfg_lookahead_extends.zip
here:

http://www.boost-consulting.com/vault/index.php?&directory=Strings%20-%20Text%20Processing

However, instead of using '[]' to separate the equations, like spirit,
this prototype uses ','.

Maybe the lookahead prototype could give you some ideas for
constructing the equations and solving them for your
PDE solver.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk