Skip to content

Latest commit

 

History

History

README.md

C++ code for the FMM Solver

Prerequisites

Installation

Add the following CMakeUserPresets.json (user specific) to the project directory:

{
  "version": 2,
  "configurePresets": [
    {
      "name": "default",
      "inherits": "vcpkg",
      "environment": {
        "VCPKG_ROOT": "<path to vcpkg>"
      }
    }
  ]
}

Then run

cmake --preset=default
# or
make sync

Note : the first time you run this command will take a while to finish, as vcpkg downloads, configures and compiles the source code of each package instead of downloading a precompiled dynamic library.

Building

cmake --build build
# or
make

This will build the shared library libfmm-solver.[so, dll] in build/ depending on your operating system. It will also build an executable fmm-solver-test to run cases written in test/test.cpp.

Adding dependencies

After finding a package on vcpkg, run

vcpkg add port <package>

Then, rerun the cmake preset command. vcpkg will indicate the lines to add to CMakeLists.txt. Add it, and rebuild.

Dependencies used

  • Boost.MultiArray is used to represent the 3D arrays in the FMMTree struct.
  • Boost.QVM provides an implementation for the arithmetic on 3x3 matrices and size 3 vectors.
  • fmt is used for string formatting and printing.
  • doctest allows to write test cases in a convenient way.
  • Matplot++ is a simple interface to Gnuplot for plotting.