berenger-eu / tbfmm

Task-based fast multipole method, parallelized using OpenMP and StarPU. With StarPU it supports multiple GPUs (CUDA).
Other
9 stars 3 forks source link

Minimal working example #6

Open ArturSalamatin opened 1 year ago

ArturSalamatin commented 1 year ago

Would you be so kind to provide a minimal working example with a concrete potential calculation? My colleagues, and I are a bit lost with the code.

Now it seems to me that there is a slight confusing with terminology... Am I right that the kernel in your library stands for the way of interpolating an interaction potential, rather than a concrete Green function is a kernel in a convolution operation?

But how could I implement a particular interaction potential and calculate its value efficiently in a set of spatial points using your library?

As a simplest use case we are considering a code implementation of this math: fmm.pdf

Any comments are highly appreciated.

Thank you in advance

berenger-eu commented 1 year ago

Indeed, in my case a kernel includes all operations performed in the FMM: P2M, M2M, M2L, L2L and L2P. Somehow, I use this term no matter how these operations are actually implemented.

For the math you want to implement, I would suggest to do a draft outside tb-fmm, build the matrices, test with one source and one target, ensure the accuracy is OK.

Then, port this into tb-fmm by creating a new kernel by implementing the operations in https://github.com/berenger-eu/tbfmm/blob/master/examples/exampleEmptyKernel.cpp

Here the KernelExample will have to initiate and use the interaction matrices.

Please let me know if you have any question or remark.

ArturSalamatin commented 1 year ago

So far, I understand that the class FRotationKernel essentially implements the electrostatic potential generated by point-charges in 3D space. This is confirmed by the code-line https://github.com/berenger-eu/tbfmm/blob/5824e3ccad9abf821a12dcacb45b74defd65b73d/src/kernels/rotationkernel/FRotationKernel.hpp#L38

Thus, all expansions implemented in your library are for the potential |r-a|^{-1}.

FYI,

The paper that I mention is focused on a 2D field generated by electric charges. Corresponding expansions can be found there. I think, we are going to implement them as a part of your library in the nearest future as a warm-up worked example.

The ultimate goal of our research group is to be able to solve a heat/diffusion equation in 3D with a linearly distributed time-dependent source term. Corresponding function is typically called heat kernel https://en.wikipedia.org/wiki/Heat_kernel

ArturSalamatin commented 1 year ago

In comments to your code you mention a paper https://github.com/berenger-eu/tbfmm/blob/5824e3ccad9abf821a12dcacb45b74defd65b73d/src/kernels/rotationkernel/FRotationKernel.hpp#L924-L927

and a PhD report of Pierre Fortin https://github.com/berenger-eu/tbfmm/blob/5824e3ccad9abf821a12dcacb45b74defd65b73d/src/kernels/rotationkernel/FRotationKernel.hpp#L1158-L1175

Would you be so kind to share these documents with me? Unfortunately, I was not able to find them in the internet.

ArturSalamatin commented 1 year ago

Which reference would you recommend to get a proper explanation of what is exactly understood under X2Y expansions and translations? So, we could relate methods of your library with the expansions available in the literature.

berenger-eu commented 1 year ago

Yes could you give me your email ? I cannot make those document public.

ArturSalamatin commented 1 year ago

I have just sent you an e-mail @inria.fr Thank you!