Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would go another way. Implement all primitive types, composition functionality, traversal, simulation, and flow control functionality in C/C++ and add a rich interactive shell.</p> <p>This can be done with minimum effort using <a href="http://www.swig.org/" rel="nofollow noreferrer">SWIG</a>. It adds a scripting interface to the application and lots of scripting languages are supported.</p> <p>Having a simulator with rich shell interface the engineers (not software engineers) with domain knowledge can easily create prototype scripts for simulation/modelling, debug and tune these scripts, and then, if the performance is not enough, the bottleneck code can be easily ported by the software owner from the scripts to the native C/C++ code.</p> <p>This approach is used in the most EDA systems (Cadence, Synopsys, etc.) having to simulate the systems with >10e9 units in the model and has proven to be the best solution for the CAD software. In fact, it is almost never required to rewrite scripts into the native language, because the most time is spent in differential equations systems solvers, implemented in native languages.</p> <p>ADDITION: You can have a look at the <a href="http://www.swig.org/tutorial.html" rel="nofollow noreferrer">tutorial</a> explaining how to enable a scripting interface in C++ program. I would choose <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm" rel="nofollow noreferrer">TCL</a> as it is a very simple yet sufficient scripting language, all commands can fit on one page. There should not be any problems teaching engineers and you can always document only a small subset of the functionality, to mimic your original syntax example.</p> <p>Your simulation script would look as below</p> <pre><code>package require my_models ;# load and initialize models package require my_preconditioners ;# load and initialize preconditioners package require my_solvers ;# load and initialize solvers package require my_simulators ;# load simulators set mdl [model_create "boeing_777_new"] ;# create jet model set wing [model_load "ceramic_112233_long" "/mnt/proj/777/wing.models"] ;# load wings models model_set_param $wing "paint" "silver_xx_233445" ;# change some parameter model_add_element $mdl "wing_left" [model_new_instance $wing] #; instantiate a wing and add it to the jet, left model_add_element $mdl "wing_right" [model_new_instance $wing] #; instantiate a wing and add it to the jet, right set sim [simulator_load "simplified_linear_air_flow" "/mnt/proj/777/worlds.xml"] #; load some linear simulator with predefined parameters from an xml file simulator_add_object [model_new_instance $mdl] ;# instantiate a jet in the simulator simulator_set_param $sim "altitude" 12000 simulator_set_param $sim "temperature" -54 simulator_set_output "/tmp/sim.dmp" simulator_run "10 sec" exit </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload