Skip to content

Commit

Permalink
mearg with development branch
Browse files Browse the repository at this point in the history
  • Loading branch information
skhayrulin committed Jul 28, 2015
2 parents fc8023a + 3dad232 commit c48fb40
Show file tree
Hide file tree
Showing 45 changed files with 969,157 additions and 858,980 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/release/Smoothed-Particle-Hydrodynamics
/src/main_sim.py~
/Release/Sibernetic
*~
# Compiled Object files
*.slo
*.lo
Expand Down
104 changes: 94 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
![Sibernetic](http://i.imgur.com/Hbsw6Zs.png)

Sibernetic is a fluid mechanics simulator developed for simulations of C. elegans developed for the [OpenWorm](http://openworm.org) project by Andrey Palyanov, Sergey Khayrulin and Mike Vella as part of the [OpenWorm team](http://www.openworm.org/people.html). Sibernetic provides an implementation of the PCISPH contractile matter algorithm for simulating muscle tissue and is being applied to C. elegans locomotion.
Sibernetic is a fluid mechanics simulator developed for simulations of C. elegans in the [OpenWorm project](http://www.openworm.org) developed for the [OpenWorm](http://openworm.org) project by Andrey Palyanov, Sergey Khayrulin and Mike Vella as part of the [OpenWorm team](http://www.openworm.org/people.html). Sibernetic provides an implementation of the PCISPH contractile matter algorithm for simulating muscle tissue and is applies to C. elegans locomotion.

When driven by electrical activity generated by simulated neurons using the [Hodgkin Huxley model](https://en.wikipedia.org/wiki/Hodgkin%E2%80%93Huxley_model) contractile matter is called Electrofluid (this feature is in the early stages of development).
When driven by [Hodgkin Huxley dynamics](https://en.wikipedia.org/wiki/Hodgkin%E2%80%93Huxley_model) contractile matter is called Electrofluid.

Sibernetic is primarily written in C++ and OpenCL, and also features interaction with Python scripts.
Sibernetic is primarily written in C++ and OpenCL, it also provides a Python API.

There is a separate effort lead by [Giovanni Idili](https://github.com/gidili) and [Sergey Khayrulin](https://github.com/skhayrulin) to port this code to Java, as part of the [Geppetto simulation framework](http://docs.geppetto.org/en/latest/).
There is a separate effort lead by [Giovanni Idili](https://github.com/gidili) and [Sergey Khayrulin](https://github.com/skhayrulin) to port this code to Java, as part of the [Geppetto simulation framework](https://github.com/openworm/OpenWorm/wiki/Geppetto--Overview).

Compiling / running (Linux/mac)
------------------------------

**Linux**

Install OpenCL on Ubuntu. We suggest you initially go with [AMD OpenCL drivers](http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/) as we have found these to be the most stable and complete. You can also try [Intel's drivers](http://develnoter.blogspot.co.uk/2012/05/installing-opencl-in-ubuntu-1204.html). This step often causes problems, contact the [openworm-discuss](https://groups.google.com/forum/#!forum/openworm-discuss) mailing list if you encounter issues, or check [here](https://github.com/openworm/Smoothed-Particle-Hydrodynamics/issues). The AMD drivers include samples in /opt/AMDAPP/samples/opencl/bin which you can use to verify your OpenCL support is working.
Install OpenCL on Ubuntu. We suggest you initially go with [AMD OpenCL drivers](http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/) as we have found these to be the most stable and complete. You can also try [Intel's drivers](http://develnoter.blogspot.co.uk/2012/05/installing-opencl-in-ubuntu-1204.html). This step often causes problems, contact the [openworm-discuss](https://groups.google.com/forum/#!forum/openworm-discuss) mailing list if you encounter issues. The AMD drivers include samples in /opt/AMDAPP/samples/opencl/bin which you can use to verify your OpenCL support is working.

You'll also need a variety of libraries. In ubuntu, install the dependencies with:

```
sudo apt-get install g++ python-dev freeglut3-dev nvidia-opencl-dev libglu1-mesa-dev libglew-dev python-numpy
```

When these are installed run:
Next, navigate to the `Release` folder and run:

```
make clean
make all
```

**Mac**

From the top-level folder and run:
**Mac**: stay in the top-level folder and run:

```
make clean -f makefile.OSX
Expand All @@ -53,7 +51,7 @@ g++ -L/usr/lib -L/usr/lib/python2.7 -o "Smoothed-Particle-Hydrodynamics" ./src/
Finished building target: Smoothed-Particle-Hydrodynamics
```

Set your `PYTHONPATH`:
Then navigate to the top-level folder in the hierarchy (e.g `Smoothed-Particle-Hydrodynamics`) and set your `PYTHONPATH`:

```
export PYTHONPATH=$PYTHONPATH:'./src'
Expand Down Expand Up @@ -85,6 +83,7 @@ Compilation failed:
#include "src//owOpenCLConstant.h"
```


What's inside
-------------

Expand All @@ -108,6 +107,91 @@ References
2. M. Ihmsen, N. Akinci, M. Gissler, M. Teschner, Boundary Handling and Adaptive Time-stepping for PCISPH Proc. VRIPHYS, Copenhagen, Denmark, pp. 79-88, Nov 11-12, 2010.
3. M. Becker, M. Teschner. Weakly compressible SPH for free surface flows // Proceedings of the 2007 ACM SIGGRAPH/Eurographics symposium on Computer animation, pages 209-217.

Main command options
--------------
To start Sibernetic with argument print in command prompt next ./Release/Sibernetic -whatever
Available options:
```
-g_no Run without graphics
-l_to Save simulation results to disk.
-l_from Load simulation results from disk.
-test Run some physical tests.
-f <filename> Load configuration from file ./configuration/<filename>.
device=<device_type> Trying to init OpenCL on device <type> it could be cpu or gpu
default-ALL (it try to init most powerful available device).
timestep=<value> Start simulation with time step = <value> in seconds.
timelimit=<value> Run simulation until <value> will be reached in seconds.
leapfrog Use for integration LeapFrog method
-help Print this information on screen.
```

LeapFrog integration
--------------
[Leapfrog](https://en.wikipedia.org/wiki/Leapfrog_integration) is second order method insted of [Semi-implicid Euler](https://en.wikipedia.org/wiki/Semi-implicit_Euler_method) which we are using as default method for integration. For run simulation with Leapfro integration medhod print run command
```
./Release/Sibernetic leapfrog
```

Run simulation from configuration file
--------------
All configuration is stored in ./configuration folder there are two demo configuration demo1 and demo2 (demo1 is using as default demonstarative configuration). You can switch between two demo configurations directly inside the working Sibernetic - just push button '1' or '2' respectively. For run your configuration put you're configuration file into configuration folder and run Sibernetic with key
```
./Release/Sibernetic -f <configuration_file_name>.
```
For run worm body simulation you should run Siberntic with key
```
./Release/Sibernetic -f worm
```
it load worm body simulation and run pyhon modul which is responsible for muscle signal updating. If you want work with worm body configuration generator you should change branch to WormBodySimultion.

Control in graphical mode
---------------
If you run Sibernetic with graphic you can work with scene rotate and scaling by mouse. Also you several control button is available:
```
'Space' - pause simulation
's' - save current configuration into file ./configuration/snapshot/configuration_default you can run this
than (./Release/Sibernetic -f /snapshot/configuration_default).
'q' or 'Esc' - quit the semulation
'1' - run demo1 configuration
'2' - run demo2 configuration
```

Configuration file format
---------------
Configuration file is consist from:
```
First 6 lines is spatial description of boundary box
xmin
xmax
ymin
ymax
zmin
zmax
[position] - contains information about position of all particles e.g.
1 0 0 1
1 0 0 1
...
[velocity] - contains infomation about velocityes of all particles e.g.
0 0 0 1
0 0 0 1
...
[connection] - contains infomation about elastic connection of all elastic particles e.g.
1 1.58649939377 1.1 0.0
7 1.58649939377 1.1 0.0
...
[membranes] - contains infomation about membranes e.g.
0 1 7
7 8 1
...
[particleMemIndex] - contains infomation about in which membranes elastic particle is includes e.g.
0
144
288
-1
...
```


Saving to disk
--------------
You can run Sibernetic on gpu for this you should start Sibernetic with key device=gpu.
Expand Down
28 changes: 25 additions & 3 deletions Sibernetic.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="SimulationEnginePrototype"
Name="Sibernetic"
ProjectGUID="{01EA498F-06C1-4F67-8B98-E1105F9311A2}"
RootNamespace="SimulationEnginePrototype"
Keyword="Win32Proj"
Expand Down Expand Up @@ -61,6 +61,8 @@
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\$(ProjectName).exe"
Version="0.0.1"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;lib/$(PlatformName)&quot;"
GenerateDebugInformation="true"
Expand Down Expand Up @@ -135,6 +137,8 @@
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\$(ProjectName).exe"
Version="0.0.1"
LinkIncremental="1"
AdditionalLibraryDirectories="C:\Python25\libs;&quot;lib/$(PlatformName)&quot;"
GenerateDebugInformation="true"
Expand Down Expand Up @@ -210,6 +214,8 @@
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\$(TargetName).exe"
Version="0.0.1"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;lib/$(PlatformName)&quot;"
GenerateDebugInformation="true"
Expand Down Expand Up @@ -264,13 +270,21 @@
>
</File>
<File
RelativePath=".\src\owWorldSimulation.cpp"
RelativePath=".\src\test\owPhysicTest.cpp"
>
</File>
<File
RelativePath=".\src\test\owPhysicTest.cpp"
>
</File>
<File
RelativePath=".\src\owWorldSimulation.cpp"
>
</File>
<File
RelativePath=".\src\PyramidalSimulation.cpp"
>
</File>
<File
RelativePath=".\src\sphFluid.cl"
>
Expand Down Expand Up @@ -315,16 +329,24 @@
RelativePath=".\inc\owPhysicsFluidSimulator.h"
>
</File>
<File
RelativePath=".\inc\owPhysicTest.h"
>
</File>
<File
RelativePath=".\inc\owWorldSimulation.h"
>
</File>
<File
RelativePath=".\inc\PyramidalSimulation.h"
>
</File>
<File
RelativePath=".\inc\VectorMath.h"
>
</File>
<File
RelativePath=".\inc\owPhysicTest.h"
RelativePath=".\inc\owConfigProperty.h"
>
</File>
</Filter>
Expand Down
Loading

0 comments on commit c48fb40

Please sign in to comment.