ScalFmm  ..
Quick Start

In this section, we present the organization of the data structures and the classes design to understand completly ScalFmm and to customize it.

Remark 1.2 : There is a big difference between the versions 1.0 and 1.2 since we do not store array of particles anymore but rather several arrays. This was needed in order to be able to vectorize the P2P code directly from the particles.

Remark 1.3 : There is a big difference between the versions 1.2 and 1.3 The precision is chosen with template (usually called FReal) and no more during the configure. Therefor, almost all classes have FReal as a template, and it is possible to use different accuracies for the template and the position for example.

We would like to inform users who want to create a kernel (or to execute FMM from a high level) and who are not familiar with 'C++' but are familiar with 'C' that a C API have been made for them. In order to get access to this API, go in Addons/CKernelApi. (To compile, enable the addons and then the CKernelApi in the CMake stage). However, to have access to all the features of ScalFmm it is required to use C++ as described in this QuickStart.

Prerequisite

It is recommended to have built the library or at least to have downloaded the source code. The users need to be comfortable with the 'C++' language and if possible also with templates and 'C++11'.

If you want to browse the code, you may want to see first our Programming rules of ScalFMM project.

Overview of general architecture

General architecture

What Data

In ScalFmm we proceed the Fast Multipole Method. New users should see this process as a way to estimate far interactions and compute accurately the close interactions in a group of particles. We start with some particles (unknowns) that we insert in a octree. The octree stores the particles in its leaves. From the root to the leaves there are the cells. At this point we only express primitives classes which hold data or primitives classes.

Then, we need a kernel which is the computational part of the FMM. It is a class that is able to compute the interactions between particles or cells, etc. There are several possible kernels depending on what we want to compute and it is easy to implement your own.

Finally, the FMM Core algorithm is a class that takes the primitives classes and calls the kernel with the correct arguments. In our implementation, the user has to choose between sequential FMM or OpenMP FMM or even MPI FMM.

From the previous paragraphs we derive three main parts of the FMM, the algorithm, the data structures (containers) and the kernels. ScalFMM respect this organization with the help of templates.

Primitives Classes

Particles

In order to put the particles in the right leaf, the octree needs to know their spatial positions (but nothing more). From a position, once the right leaf is found, this one is allocated (using the given template LeafClass of the octree), and the particles is pushed into the leaf. If a basic leaf is used, this one only push to a particles container what it has received. So a particle container is nothing more than a class that has a push method which matches the one you call on the octree. To ensure that, a particle container should inherit from FAbstractParticleContainer.

template <class FReal>
class FAbstractParticleContainer{ 
  template<typename... Args>
  void push(const FPoint<FReal>& /*inParticlePosition