FAQ - PetcuAlexandru/openpixi GitHub Wiki
- How do I avoid the ArrayIndexOutOfBoundsException in the interpolation code when my particles get too fast?
- How do I take advantage of multi-core processor and direct OpenPixi to use threads?
How do I avoid the ArrayIndexOutOfBoundsException in the interpolation code when my particles get too fast?
You can use the relativistic solvers which limit the maximum particle speed. If for example you want to make sure that the particle does not move further than the width of a cell you can use the following set up code
Settings settings = new Settings();
settings.setParticleSolver(new BorisRelativistic(
settings.getSimulationWidth() / settings.getTimeStep()));
How do I take advantage of multi-core processor and direct OpenPixi to use threads?
You can use the parallelization by simply setting the number of threads you want to use.
Settings settings = new Settings();
settings.setNumOfThreads(4);
Once you use the parallel version you have to remember to terminate the running threads by calling settings.terminateThreads()
.