This repository contains 2 implementations of a Bayesian sequential procedure touse when operating particle-tracking models to simulate multiphase flows. Full details on the algorithm being applied are in paper, "Resource Allocation for Lagrangian Tracking" (https://doi.org/10.1175/JTECH-D-15-0115.1). The first implementation is in R. The second implementation is writted in C++ and includes a SWIG configuration file to generate bindings for other languages. The two implementations may give minor differences in the results due to differences between the returned values from rmultinom() in R and gsl_ran_multinomial() from the GNU Scientific Library.
The R implementation may be installed using the below command within R. It depends only on the gtools and igraph libraries which may be obtained from CRAN.
install.packages('gtools', 'igraph')
devtools::install_github('jonesbt/sequential-analysis-software')
The C++ implementation consists of 1 source code file, 1 header file, a makefile, and a SWIG file. In addition, a second source code file is provided that implements unit tests for the library.
Paste the below command at a Terminal prompt. The script explains any changes that it will make, then pauses prior to installing any new software.
curl -O -fsSL https://raw.githubusercontent.com/jonesbt/sequential-analysis-software/master/install.sh && /bin/bash install.sh
For now, we recommend that Windows users install the R package unless they are familiar with compiling C++ code. If you wish to install the C++ library anyway, you'll need to install the dependencies listed below, then modify src/makefile to work with your system.
The C++ implementation includes a SWIG configuration to generate bindings for use with other languages. For example, the below command will generate a Python module that allows access to the public interface of the sequential analysis routine. Generating bindings for other languages is similar. Please see the SWIG documentation for details on modifying the target for other languages.
# Build the package.
cd src && make python
# Import the package and create a connectivity matrix.
python
import sequential_analysis_wrap
cm = sequential_analysis_wrap.ConnectivityMatrix(
['Origin 0', 'Origin 1'],
['Destination 0', 'Destination 1', 'Destination 2']
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.