QuoteOriginally posted by: CuchulainnLooking at MM code for FDM, is that a kind of scripting language? I am sure someone could do it in Boost Spirit. I know Xpressive, would it do the job or do we need more?It's native Mathematica, a very elegant, functional programming language (well, multi-paradigm really, but it really fits the FP paradigm well). Comparisons are made to APL and LISP:http://reference.wolfram.com/legacy/v1/ ... 2.7.pdfbut
also to C:http://reference.wolfram.com/legacy/v1/ ... .2.4.pdfAs
far as C++ libs go, I like the OpenFOAM's syntax:"solve ( fvm::ddt(rho, U) + fvm::div(phi, U) - fvm::laplacian(mu, U) == - fvc::grad(p) );" OpenFOAM"3.1.3 Equation representationA central theme of the OpenFOAM design is that the solver applications, written using the OpenFOAM classes, have a syntax that closely resembles the partial differential equations being solved." -- ideally something we should be striving for?http://www.openfoam.com/docs/user/progr ... econd-best
is perhaps Overture (although it's visibly on a lower conceptual level -- note that below is a specific FDM scheme, not a general equational formulation as above):Overture http://computation.llnl.gov/casc/Overtu ... .pdf"u+=dt
*( -a*u.x()-b*u.y()+nu*(u.xx()+u.yy()) ); // forward Eulert+=dt;u.interpolate();u.applyBoundaryCondition(0,dirichlet,allBoundaries,0.);u.finishBoundaryConditions();"BTW, another PDEs-solving library, OpenCurrent, that we might look at at some point (esp. its Static Communication Patterns):http://code.google.com/p/opencurrent/wi ... Doc"Design
PrinciplesThe OpenCurrent library follows a small number of design principles throughout the codebase: Static Communication Patterns: In a complex system, managing communication is one of the most difficult and important aspects for correctness and performance. OpenCurrent follows the philosophy that all communication patterns must be declared up-front statically, and cannot be changed once the data structures are created. This greatly simplifies the run-time system, since it allows communication patterns to be hard-coded at start-up, which puts the burden for choosing how best to arrange communcation onto the programmer. This allows OpenCurrent to have a very lightweight run-time system, which improves performance and makes the overall code-base simpler. "Another might be FunctionParser mentioned as an optional dependency for deal.II:http://www.dealii.org/ http://warp.povusers.org/FunctionParser/"For
example, a function like "sin(sqrt(x*x+y*y))" can be parsed from a string (either std::string or a C-style string) and then evaluated with different values of x and y. This library can be useful for evaluating user-inputted functions, or in some cases interpreting mathematical expressions in a scripting language.This library aims for maximum speed in both parsing and evaluation, while keeping maximum portability. The library should compile and work with any standard-conforming C++ compiler."