![]() |
Karamelo
714599e9
Parallel Material Point Method Simulator
|
Karamelo executes by reading commands from a input script (a text file), one line at a time. When the input script ends, Karamelo exits. Each command causes Karamelo to take some action. It may set a variable, read in a file, or run a simulation. The syntax used is easy and flexible. One can for example intuitively add new variables that can be constant:
or depend on internal variables such as time – using the time variable – or the particle positions – using the x, y or z variables:
The list of internal variable to date are:
Variable | Description |
---|---|
x0 | Particle or node position in the x direction in the reference state. |
y0 | Particle or node position in the y direction in the reference state. |
z0 | Particle or node position in the z direction in the reference state. |
x | Current particle or node position in the x direction. |
y | Current particle or node position in the y direction. |
z | Current particle or node position in the z direction. |
time | Current simulation time. |
timestep | Current time step. |
dt | Current timestep, i.e. \(\Delta t\). |
PI | Number \(\pi\). |
Everything else is controlled through functions. For instance, the global dimensionality of the simulation, the domain’s size, and the background grid cell size are set by the dimension() command, for example:
Just like with programming languages, ordering of commands in an input script can be important. The following rules apply:
Karamelo does not read your entire input script and then perform a simulation with all the settings. Rather, the input script is read one line at a time and each command takes effect when it is read. Thus this sequence of commands:
does something different than:
In the first case, the specified timestep (0.001) is used for two simulations of 100 timesteps each. In the 2nd case, the timestep corresponding to the CFL condition is used for the 1st 100 step simulation and a 0.001 timestep is used for the 2nd one.
A user variable cannot be used before it's defined. Therefore this code
returns
But don't worry too much as many input script errors are detected by Karamelo and an ERROR or WARNING message is printed.