Run your first project (tutorial)


your first simulation

This page describes how to run your first project


You must follow the previous tutorial steps before starting this tutorial. Before continuing, please check that your current project structure looks like :

├── build
├── CMakeLists.txt
├── Main.cpp
├── my-project.inp
├── PlugIn_BuildDomain.cpp
└── PlugIn_BuildDomain.hpp
├── my-project.inp

Compiling your project

To compile your project simply type

$ cd build && cmake ../ && make && cd ../

If you get a problem here, please check your C++ source code.

Writting your .inp file

Now, you must build a new input file. Remind that you just want to build a simple discrete domain, save it and exit. Create a new file named build-domain.inp and put inside the following xml code.

<GranOO Version="2.0" OutDir="MyDomain">

    <PlugIn Id="BuildDomain" Length="1" Radius="0.1" Number="5"/>
    <PlugIn Id="_SaveDomain" FileName="MyFirstDomain.agdd"/>

Note the usage of the standard plugin _SaveDomain that saves the domain into a file.

Running your project

To run your project simply type

$ ./build/my-project.exe ./build-domain.inp
$ python ./ ./build-domain.inp

The simulation creates a new directory named MyDomain. You can change the name of this directory by setting the attribute value OutDir of the <GranOO ....> tag. Typically, this directory contains all result files of a simulation. In this case, this directory contains the discrete domain file that you built with your custom plugin.

Viewing result

You can use here the granoo-viewer that display in 3D the content of granoo domain files

$ granoo-viewer ./MyDomain/

You must see, something like this : gddviewer that shows a simple domain