Skip to main content

StoSpa2

Build Status Documentation Status


A C++ software package for stochastic simulations of spatially extended systems. Code-base has been completely refactored since the previous version of StoSpa. Python bindings have also been included.

Requirements

Necessary:

  • C++ compiler (GCC, clang)
  • Cmake (>= 3.5)
  • Make (or ninja)

Optional:

  • Pybind11 - to build pystospa (python binding of StoSpa2)
  • Python (>=3.5)
  • Boost - if boost branch of StoSpa2 is used
  • Doxygen - to build C++ documentation
  • Sphinx - to build python documentation

Installation

After cloning this repository using

git clone https://github.com/BartoszBartmanski/StoSpa2.git --recursive

compile the package with

cd StoSpa2
mkdir build
cmake ../
make all

Example

Included in the src directory is a cpp file example.cpp where we run a simple simulation of diffusion on a one-dimensional domain [0, 10] discretised into 10 voxels.

First, we include the main header from StoSpa2 and we start the main function that will contain the code for the simulation.

#include "simulator.hpp"

using namespace StoSpa2;

int main() {

Within the main function we first define a lambda function for the propensity function of a diffusion reaction.

auto diffusion = [](const std::vector<unsigned>& mols, const double& area) { return mols[0]; };

Then, we create an array of voxels, each of size 1, with 10000 molecules in the leftmost one, as shown below.

std::vector<Voxel> vs = std::vector<Voxel>(9, Voxel({0}, 1.0));
vs.insert(vs.begin(), Voxel({10000}, 1.0));

We add diffusion reactions to all the voxels

for (unsigned i=0; i<vs.size()-1; i++) {
    vs[i].add_reaction(Reaction(1.0, diffusion, {-1}, i+1));
    vs[i+1].add_reaction(Reaction(1.0, diffusion, {-1}, i));
}

and finally, we create a simulator instance and run the simulation.

Simulator sim(vs);
sim.run("example.dat", 0.01, 1000);
}

The resulting simulation output:

Simulation output

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pystospa-2.0.17-cp38-cp38-manylinux2010_x86_64.whl (116.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

pystospa-2.0.17-cp37-cp37m-manylinux2010_x86_64.whl (117.3 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

pystospa-2.0.17-cp36-cp36m-manylinux2010_x86_64.whl (117.3 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

pystospa-2.0.17-cp35-cp35m-manylinux2010_x86_64.whl (117.3 kB view details)

Uploaded CPython 3.5mmanylinux: glibc 2.12+ x86-64

pystospa-2.0.17-cp34-cp34m-manylinux2010_x86_64.whl (117.3 kB view details)

Uploaded CPython 3.4mmanylinux: glibc 2.12+ x86-64

pystospa-2.0.17-cp27-cp27mu-manylinux2010_x86_64.whl (117.9 kB view details)

Uploaded CPython 2.7mumanylinux: glibc 2.12+ x86-64

pystospa-2.0.17-cp27-cp27m-manylinux2010_x86_64.whl (117.9 kB view details)

Uploaded CPython 2.7mmanylinux: glibc 2.12+ x86-64

File details

Details for the file pystospa-2.0.17-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pystospa-2.0.17-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 116.0 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for pystospa-2.0.17-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 093dd6e06ade04ecd78cc61f14f15975f6628ff036ddcda2ecc56f9df4c9958c
MD5 ec602520d6acfaf83d97f0ca6ce18d0e
BLAKE2b-256 07dc06dcad0676a57b9f9ee5276cb7bbd0fc0275f71d9de19a5e694ca9535913

See more details on using hashes here.

File details

Details for the file pystospa-2.0.17-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pystospa-2.0.17-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 117.3 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for pystospa-2.0.17-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d31ed522077ae765afd747ad76cef008b98ed307495a1e821aa4a5fb1ab4b8bf
MD5 0a65b51dd1d53ccfeaa7c448717cb27b
BLAKE2b-256 41feb3a5902317800be723a651e2c43ac9d60a051990a049f9a0969787228c64

See more details on using hashes here.

File details

Details for the file pystospa-2.0.17-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pystospa-2.0.17-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 117.3 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for pystospa-2.0.17-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c55145877cd401577cbedd24652442f4f2f6ca81686090d20214e03b19cf634f
MD5 8e92d19bbfc8e54a782309103ff3339e
BLAKE2b-256 d07224a3b1d463014e655a21bb6e05e95733972d5ff69b34c20622269fbbb16e

See more details on using hashes here.

File details

Details for the file pystospa-2.0.17-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pystospa-2.0.17-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 117.3 kB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for pystospa-2.0.17-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 3b04371f103abe81c51c3ba7f13df7a06324be468d0dae8addf682a47cc6d7ad
MD5 c2d8e37c71a3088c07c1f83404dc2347
BLAKE2b-256 1119e6df5372bf6239d80a62fc906a1f7bd00fef1945d112ba68e81ed94f6ba6

See more details on using hashes here.

File details

Details for the file pystospa-2.0.17-cp34-cp34m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pystospa-2.0.17-cp34-cp34m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 117.3 kB
  • Tags: CPython 3.4m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for pystospa-2.0.17-cp34-cp34m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 bda2c0e4856a5549f24801d9c761f11c84ed07c2b23dbee8dc1ff215a9be9f52
MD5 5d441900d3aa3a60803d5b1f528d366d
BLAKE2b-256 15bd428b64d66fb43b33474e1c8411ced96d9f1f80bad0a1911fe6f09f185aa9

See more details on using hashes here.

File details

Details for the file pystospa-2.0.17-cp27-cp27mu-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pystospa-2.0.17-cp27-cp27mu-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 117.9 kB
  • Tags: CPython 2.7mu, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for pystospa-2.0.17-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d7fd11ee0eab1df6869d782f841d5f96d0c2ae826b2a34f9f823af3bdaef6548
MD5 56cb9d086191a1df4d43c5ef4d57ff56
BLAKE2b-256 c1de6014596f571c117819ddc0492b82ff2b698e944f7a4ef1f7191320fdcffb

See more details on using hashes here.

File details

Details for the file pystospa-2.0.17-cp27-cp27m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pystospa-2.0.17-cp27-cp27m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 117.9 kB
  • Tags: CPython 2.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for pystospa-2.0.17-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ffc5a006d3e440b7b5f62379834898fc91f29c733a4a89d42623899f6f71d39e
MD5 6c767b4e2280d2516f63d40054a6b331
BLAKE2b-256 c02d1d23b61fee52c79a10aa8960910192c7c4f986d0e7afc82a32e404e85d7c

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.30

1 file

2.0.29

1 file

2.0.28

1 file

2.0.26

1 file

2.0.25

1 file

2.0.24

1 file

2.0.23

1 file

2.0.22

1 file

2.0.21

1 file

2.0.20

1 file

2.0.19

8 files

2.0.18

7 files

This release

2.0.17 This release

7 files

2.0.16

7 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page